This commit is contained in:
ls
2024-11-19 11:50:12 +08:00
parent 9ef7a8e909
commit 293f584b10
9 changed files with 258 additions and 576 deletions

556
README.md
View File

@@ -1,531 +1,25 @@
# minio bucket 权限配置
JeecgBoot 低代码开发平台
=============== ```json
当前最新版本: 3.7.0发布日期2024-06-17 {
"Version": "2012-10-17",
"Statement": [
[![AUR](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://github.com/zhangdaiscott/jeecg-boot/blob/master/LICENSE) {
[![](https://img.shields.io/badge/Author-北京国炬软件-orange.svg)](http://jeecg.com/aboutusIndex) "Sid": "PublicReadGetObject",
[![](https://img.shields.io/badge/Blog-官方博客-blue.svg)](https://jeecg.blog.csdn.net) "Effect": "Allow",
[![](https://img.shields.io/badge/version-3.7.0-brightgreen.svg)](https://github.com/zhangdaiscott/jeecg-boot) "Principal": {
[![GitHub stars](https://img.shields.io/github/stars/zhangdaiscott/jeecg-boot.svg?style=social&label=Stars)](https://github.com/zhangdaiscott/jeecg-boot) "AWS": [
[![GitHub forks](https://img.shields.io/github/forks/zhangdaiscott/jeecg-boot.svg?style=social&label=Fork)](https://github.com/zhangdaiscott/jeecg-boot) "*"
]
},
"Action": [
项目介绍 "s3:GetObject"
----------------------------------- ],
"Resource": [
<h3 align="center">Java Low Code Platform for Enterprise web applications</h3> "arn:aws:s3:::physical/*"
]
JeecgBoot 是一款基于代码生成器的`低代码开发平台`!前后端分离架构 SpringBoot2.x和3.xSpringCloudAnt Design&VueMybatis-plusShiroJWT支持微服务。强大的代码生成器让前后端代码一键生成实现低代码开发! JeecgBoot 引领新的低代码开发模式(OnlineCoding-> 代码生成器-> 手工MERGE) 帮助解决Java项目70%的重复工作,让开发更多关注业务。既能快速提高效率,节省研发成本,同时又不失灵活性! }
]
JeecgBoot 提供了一系列`低代码模块`,实现在线开发`真正的零代码`Online表单开发、Online报表、报表配置能力、在线图表设计、仪表盘设计、大屏设计、移动配置能力、表单设计器、在线设计流程、流程自动化配置、插件能力可插拔等等 }
```
`JEECG宗旨是:` 简单功能由OnlineCoding配置实现做到`零代码开发`复杂功能由代码生成器生成进行手工Merge 实现`低代码开发`,既保证了`智能`又兼顾`灵活`;实现了低代码开发的同时又支持灵活编码,解决了当前低代码产品普遍不灵活的弊端!
`JEECG业务流程:` 采用工作流来实现、扩展出任务接口,供开发编写业务逻辑,表单提供多种解决方案: 表单设计器、online配置表单、编码表单。同时实现了流程与表单的分离设计松耦合、并支持任务节点灵活配置既保证了公司流程的保密性又减少了开发人员的工作量。
适用项目
-----------------------------------
Jeecg-Boot低代码开发平台可以应用在任何J2EE项目的开发中支持信创国产化默认适配达梦和人大金仓。尤其适合SAAS项目、企业信息管理系统MIS、内部办公系统OA、企业资源计划系统ERP、客户关系管理系统CRM其半智能手工Merge的开发方式可以显著提高开发效率70%以上,极大降低开发成本。
#### 项目说明
| 项目名 | 说明 |
|--------------------|------------------------|
| `jeecg-boot` | 后端源码JAVASpringBoot微服务架构 |
| `jeecgboot-vue3` | 前端源码VUE3vue3+vite5+ts最新技术栈 |
| `jeecg-uniapp` | APP框架,一份代码多终端适配支持APP、小程序、H5 |
其他源码
-----------------------------------
- APP源码地址https://github.com/jeecgboot/jeecg-uniapp
技术支持
-----------------------------------
关闭gitee的issue通道使用中遇到问题或者BUG可以在 [Github上提Issues](https://github.com/jeecgboot/JeecgBoot/issues/new)
快速启动项目
-----------------------------------
- [前端项目快速启动](http://help.jeecg.com/setup/startup.html)
- [通过IDEA启动前后端项目](https://help.jeecg.com/java/setup/idea/startup.html)
Docker启动项目
-----------------------------------
- [Docker启动前端](http://help.jeecg.com/publish/docker.html)
- [Docker启动后台](https://help.jeecg.com/java/setup/docker/up.html)
微服务方式启动
-----------------------------------
- [单体快速切换微服务](https://help.jeecg.com/java/springcloud/switchcloud/monomer.html)
- [Docker启动微服务后台](https://help.jeecg.com/java/springcloud/docker.html)
技术文档
-----------------------------------
- 产品官网: [http://www.jeecg.com](http://www.jeecg.com)
- 开发文档: [https://help.jeecg.com](https://help.jeecg.com)
- 新手指南: [快速入门](http://www.jeecg.com/doc/quickstart) | [常见问题 ](http://www.jeecg.com/doc/qa) | [视频教程](https://space.bilibili.com/454617261/channel/series) | [1分钟低代码体验](https://my.oschina.net/jeecg/blog/3083313)
- AI助手配置: https://help.jeecg.com/java/chatgpt.html
- 在线演示 [在线演示](http://boot3.jeecg.com) | [APP演示](http://jeecg.com/appIndex)
> 演示系统的登录账号密码,请点击 [获取账号密码](http://jeecg.com/doc/demo) 获取
>
- QQ交流群 ⑨808791225、⑧825232878、⑦791696430(满)、⑥730954414(满)、683903138(满)、⑤860162132(满)、④774126647(满)、③816531124(满)、②769925425(满)、①284271917(满)
为什么选择JeecgBoot?
-----------------------------------
* 1.采用最新主流前后分离框架Springboot+Mybatis+antd容易上手; 代码生成器依赖性低,灵活的扩展能力,可快速实现二次开发;
* 2.支持微服务SpringCloud Alibaba(Nacos、Gateway、Sentinel、Skywalking),提供切换机制支持单体和微服务自由切换
* 3.开发效率高,采用代码生成器,单表、树列表、一对多、一对一等数据模型,增删改查功能一键生成,菜单配置直接使用;
* 4.代码生成器提供强大模板机制,支持自定义模板,目前提供四套风格模板(单表两套、树模型一套、一对多三套)
* 5.代码生成器非常智能在线业务建模、在线配置、所见即所得支持23种类控件一键生成前后端代码大幅度提升开发效率不再为重复工作发愁。
* 6.低代码能力Online在线表单无需编码通过在线配置表单实现表单的增删改查支持单表、树、一对多、一对一等模型实现人人皆可编码
* 7.低代码能力Online在线报表无需编码通过在线配置方式实现数据报表可以快速抽取数据减轻开发压力实现人人皆可编码
* 8.低代码能力Online在线图表无需编码通过在线配置方式实现曲线图柱状图数据报表等支持自定义排版布局实现人人皆可编码
* 9.封装完善的用户、角色、菜单、组织机构、数据字典、在线定时任务等基础功能,支持访问授权、按钮权限、数据权限等功能
* 10.常用共通封装,各种工具类(定时任务,短信接口,邮件发送,Excel导入导出等),基本满足80%项目需求
* 11.简易Excel导入导出支持单表导出和一对多表模式导出生成的代码自带导入导出功能
* 12.集成简易报表工具图像报表和数据导出非常方便可极其方便的生成图形报表、pdf、excel、word等报表
* 13.采用前后分离技术页面UI风格精美针对常用组件做了封装时间、行表格控件、截取显示控件、报表组件编辑器等等
* 14.查询过滤器查询功能自动生成后台动态拼SQL追加查询条件支持多种匹配方式全匹配/模糊查询/包含查询/不匹配查询);
* 15.数据权限(精细化数据权限控制,控制到行级,列表级,表单字段级,实现不同人看不同数据,不同人对同一个页面操作不同字段
* 16.页面校验自动生成(必须输入、数字校验、金额校验、时间空间等);
* 17.支持SAAS服务模式提供SaaS多租户架构方案。
* 18.分布式文件服务集成minio、阿里OSS等优秀的第三方提供便捷的文件上传与管理同时也支持本地存储。
* 19.主流数据库兼容一套代码完全兼容Mysql、Postgresql、Oracle、Sqlserver、MariaDB、达梦等主流数据库。
* 20.集成工作流flowable并实现了只需在页面配置流程转向可极大的简化bpm工作流的开发用bpm的流程设计器画出了流程走向一个工作流基本就完成了只需写很少量的java代码
* 21.低代码能力在线流程设计采用开源flowable流程引擎实现在线画流程,自定义表单,表单挂靠,业务流转
* 22.多数据源:及其简易的使用方式,在线配置数据源配置,便捷的从其他数据抓取数据;
* 23.提供单点登录CAS集成方案项目中已经提供完善的对接代码
* 24.低代码能力表单设计器支持用户自定义表单布局支持单表一对多表单、支持select、radio、checkbox、textarea、date、popup、列表、宏等控件
* 25.专业接口对接机制统一采用restful接口方式集成swagger-ui在线接口文档Jwt token安全验证方便客户端对接
* 26.接口安全机制,可细化控制接口授权,非常简便实现不同客户端只看自己数据等控制
* 27.高级组合查询功能,在线配置支持主子表关联查询,可保存查询历史
* 28.提供各种系统监控,实时跟踪系统运行情况(监控 Redis、Tomcat、jvm、服务器信息、请求追踪、SQL监控
* 29.消息中心(支持短信、邮件、微信推送等等)
* 30.集成Websocket消息通知机制
* 31.移动自适应效果优秀提供APP发布方案
* 32.支持多语言,提供国际化方案;
* 33.数据变更记录日志,可记录数据每次变更内容,通过版本对比功能查看历史变化
* 34.平台UI强大实现了移动自适应
* 35.平台首页风格,提供多种组合模式,支持自定义风格
* 36.提供简单易用的打印插件支持谷歌、火狐、IE11+ 等各种浏览器
* 37.示例代码丰富,提供很多学习案例参考
* 38.采用maven分模块开发方式
* 39.支持菜单动态路由
* 40.权限控制采用 RBACRole-Based Access Control基于角色的访问控制
* 41.提供新行编辑表格JVXETable轻松满足各种复杂ERP布局拥有更高的性能、更灵活的扩展、更强大的功能
技术架构:
-----------------------------------
#### 开发环境
- 语言Java 8+ (小于17)
- IDE(JAVA) IDEA (必须安装lombok插件 )
- IDE(前端) Vscode、WebStorm、IDEA
- 依赖管理Maven
- 缓存Redis
- 数据库脚本MySQL5.7+ (其他数据库,[需要自己转](https://my.oschina.net/jeecg/blog/4905722)
#### 后端
- 基础框架Spring Boot 2.6.14
- 微服务框架: Spring Cloud Alibaba 2021.0.1.0
- 持久层框架MybatisPlus 3.5.1
- 报表工具: JimuReport 1.5.8
- 安全框架Apache Shiro 1.10.0Jwt 3.11.0
- 微服务技术栈Spring Cloud Alibaba、Nacos、Gateway、Sentinel、Skywalking
- 数据库连接池阿里巴巴Druid 1.1.22
- 日志打印logback
- 其他autopoi, fastjsonpoiSwagger-uiquartz, lombok简化代码等。
#### 前端
- 技术栈:`Vue3.0 + TypeScript + Vite5 + ant-design-vue4 + pinia + echarts + unocss + vxe-table + qiankun + es6` 等最新技术栈
#### 支持库
| 数据库 | 支持 |
| --- | --- |
| MySQL | √ |
| Oracle11g | √ |
| Sqlserver2017 | √ |
| PostgreSQL | √ |
| MariaDB | √ |
| 达梦、人大金仓 | √ |
## 微服务解决方案
1、服务注册和发现 Nacos √
2、统一配置中心 Nacos √
3、路由网关 gateway(三种加载方式) √
4、分布式 http feign √
5、熔断降级限流 Sentinel √
6、分布式文件 Minio、阿里OSS √
7、统一权限控制 JWT + Shiro √
8、服务监控 SpringBootAdmin√
9、链路跟踪 Skywalking [参考文档](https://help.jeecg.com/java/springcloud/super/skywarking.html)
10、消息中间件 RabbitMQ √
11、分布式任务 xxl-job √
12、分布式事务 Seata
13、分布式日志 elk + kafka
14、支持 docker-compose、k8s、jenkins
15、CAS 单点登录 √
16、路由限流 √
#### 微服务架构图
![微服务架构图](https://jeecgos.oss-cn-beijing.aliyuncs.com/files/jeecgboot_springcloud2022.png "在这里输入图片标题")
### Jeecg Boot 产品功能蓝图
![功能蓝图](https://jeecgos.oss-cn-beijing.aliyuncs.com/upload/test/Jeecg-Boot-lantu202005_1590912449914.jpg "在这里输入图片标题")
### 功能模块
```
├─Online在线开发(低代码)
│ ├─Online在线表单
│ ├─Online代码生成器
│ ├─Online在线报表
│ ├─仪表盘设计器
│ ├─AI助手
│ ├─系统编码规则
│ ├─系统校验规则
├─积木报表设计器
│ ├─打印设计器
│ ├─数据报表设计
│ ├─图形报表设计支持echart
├─系统管理
│ ├─用户管理
│ ├─角色管理
│ ├─菜单管理
│ ├─权限设置(支持按钮权限、数据权限)
│ ├─表单权限(控制字段禁用、隐藏)
│ ├─部门管理
│ ├─我的部门(二级管理员)
│ └─字典管理
│ └─分类字典
│ └─系统公告
│ └─职务管理
│ └─通讯录
│ ├─多数据源管理
│ └─多租户管理(租户管理、租户角色、我的租户)
├─消息中心
│ ├─消息管理
│ ├─模板管理
├─代码生成器(低代码)
│ ├─代码生成器功能(一键生成前后端代码,生成后无需修改直接用,绝对是后端开发福音)
│ ├─代码生成器模板提供4套模板分别支持单表和一对多模型不同风格选择
│ ├─代码生成器模板生成代码自带excel导入导出
│ ├─查询过滤器(查询逻辑无需编码,系统根据页面配置自动生成)
│ ├─高级查询器(弹窗自动组合查询条件)
│ ├─Excel导入导出工具集成支持单表一对多 导入导出)
│ ├─平台移动自适应支持
├─系统监控
│ ├─Gateway路由网关
│ ├─性能扫描监控
│ │ ├─监控 Redis
│ │ ├─Tomcat
│ │ ├─jvm
│ │ ├─服务器信息
│ │ ├─请求追踪
│ │ ├─磁盘监控
│ ├─定时任务
│ ├─系统日志
│ ├─消息中心(支持短信、邮件、微信推送等等)
│ ├─数据日志(记录数据快照,可对比快照,查看数据变更情况)
│ ├─系统通知
│ ├─SQL监控
│ ├─swagger-ui(在线接口文档)
│─报表示例
│ ├─曲线图
│ └─饼状图
│ └─柱状图
│ └─折线图
│ └─面积图
│ └─雷达图
│ └─仪表图
│ └─进度条
│ └─排名列表
│ └─等等
│─大屏模板
│ ├─作战指挥中心大屏
│ └─物流服务中心大屏
│─常用示例
│ ├─自定义组件
│ ├─对象存储(对接阿里云)
│ ├─JVXETable示例各种复杂ERP布局示例
│ ├─单表模型例子
│ └─一对多模型例子
│ └─打印例子
│ └─一对多TAB例子
│ └─内嵌table例子
│ └─常用选择组件
│ └─异步树table
│ └─接口模拟测试
│ └─表格合计示例
│ └─异步树列表示例
│ └─一对多JEditable
│ └─JEditable组件示例
│ └─图片拖拽排序
│ └─图片翻页
│ └─图片预览
│ └─PDF预览
│ └─分屏功能
│─封装通用组件
│ ├─行编辑表格JEditableTable
│ └─省略显示组件
│ └─时间控件
│ └─高级查询
│ └─用户选择组件
│ └─报表组件封装
│ └─字典组件
│ └─下拉多选组件
│ └─选人组件
│ └─选部门组件
│ └─通过部门选人组件
│ └─封装曲线、柱状图、饼状图、折线图等等报表的组件(经过封装,使用简单)
│ └─在线code编辑器
│ └─上传文件组件
│ └─验证码组件
│ └─树列表组件
│ └─表单禁用组件
│ └─等等
│─更多页面模板
│ ├─各种高级表单
│ ├─各种列表效果
│ └─结果页面
│ └─异常页面
│ └─个人页面
├─高级功能
│ ├─提供单点登录CAS集成方案
│ ├─提供APP发布方案
│ ├─集成Websocket消息通知机制
│─更多商业功能
│ ├─流程设计器
│ ├─表单设计器
│ ├─大屏设计器
│ └─我的任务
│ └─历史流程
│ └─历史流程
│ └─流程实例管理
│ └─流程监听管理
│ └─流程表达式
│ └─我发起的流程
│ └─我的抄送
│ └─流程委派、抄送、跳转
│ └─OA办公组件
│ └─。。。
```
后台目录结构
-----------------------------------
```
项目结构
├─jeecg-boot-parent父POM 项目依赖、modules组织
│ ├─jeecg-boot-base-core共通模块 工具类、config、权限、查询过滤器、注解等
│ ├─jeecg-module-demo 示例代码
│ ├─jeecg-module-system System系统管理目录
│ │ ├─jeecg-system-biz System系统管理权限等功能
│ │ ├─jeecg-system-start System单体启动项目(8080
│ │ ├─jeecg-system-api System系统管理模块对外api
│ │ │ ├─jeecg-system-cloud-api System模块对外提供的微服务接口
│ │ │ ├─jeecg-system-local-api System模块对外提供的单体接口
│ ├─jeecg-server-cloud --微服务模块
├─jeecg-cloud-gateway --微服务网关模块(9999)
├─jeecg-cloud-nacos --Nacos服务模块(8848)
├─jeecg-system-cloud-start --System微服务启动项目(7001)
├─jeecg-demo-cloud-start --Demo微服务启动项目(7002)
├─jeecg-visual
├─jeecg-cloud-monitor --微服务监控模块 (9111)
├─jeecg-cloud-xxljob --微服务xxljob定时任务服务端 (9080)
├─jeecg-cloud-sentinel --sentinel服务端 (9000)
├─jeecg-cloud-test -- 微服务测试示例(各种例子)
├─jeecg-cloud-test-more -- 微服务测试示例feign、熔断降级、xxljob、分布式锁
├─jeecg-cloud-test-rabbitmq -- 微服务测试示例rabbitmq
├─jeecg-cloud-test-seata -- 微服务测试示例seata分布式事务
├─jeecg-cloud-test-shardingsphere -- 微服务测试示例(分库分表)
```
### 系统效果
##### PC端
![](https://oscimg.oschina.net/oscnet/up-000530d95df337b43089ac77e562494f454.png)
![输入图片说明](https://static.oschina.net/uploads/img/201904/14155402_AmlV.png "在这里输入图片标题")
![](https://oscimg.oschina.net/oscnet/up-9d6f36f251e71a0b515a01323474b03004c.png)
![输入图片说明](https://static.oschina.net/uploads/img/201904/14160813_KmXS.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201904/14160935_Nibs.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201904/14161004_bxQ4.png "在这里输入图片标题")
##### 系统交互
![](https://oscimg.oschina.net/oscnet/up-78b151fc888d4319377bf1cc311fe826871.png)
![](https://oscimg.oschina.net/oscnet/up-16c07e000278329b69b228ae3189814b8e9.png)
##### AI助手
![](https://oscimg.oschina.net/oscnet/up-7c6405641a40f56638999d52da0cb5b4343.png)
##### 仪表盘设计器
![](https://oscimg.oschina.net/oscnet/up-9c9d41288c31398d76b390bdd400f13a582.png)
![](https://oscimg.oschina.net/oscnet/up-fad98d42b2cf92f92a903c9cff7579f18ec.png)
##### 报表设计器
![](https://oscimg.oschina.net/oscnet/up-64648de000851f15f6c7b9573d107ebb5f8.png)
![](https://oscimg.oschina.net/oscnet/up-fa52b44445db281c51d3f267dce7450d21b.gif)
![](https://oscimg.oschina.net/oscnet/up-68a19149d640f1646c8ed89ed4375e3326c.png)
![](https://oscimg.oschina.net/oscnet/up-f7e9cb2e3740f2d19ff63b40ec2dd554f96.png)
##### 手机端
![](https://oscimg.oschina.net/oscnet/da543c5d0d57baab0cecaa4670c8b68c521.jpg)
![](https://oscimg.oschina.net/oscnet/fda4bd82cab9d682de1c1fbf2060bf14fa6.jpg)
##### PAD端
![](https://oscimg.oschina.net/oscnet/e90fef970a8c33790ab03ffd6c4c7cec225.jpg)
![](https://oscimg.oschina.net/oscnet/d78218803a9e856a0aa82b45efc49849a0c.jpg)
![](https://oscimg.oschina.net/oscnet/59c23b230f52384e588ee16309b44fa20de.jpg)
##### 图表示例
![](https://oscimg.oschina.net/oscnet/up-218bc6a1669496b241ebb23506440c0083e.png)
![输入图片说明](https://static.oschina.net/uploads/img/201904/14160834_Lo23.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201904/14160842_QK7B.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201904/14160849_GBm5.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201904/14160858_6RAM.png "在这里输入图片标题")
##### 在线接口文档
![输入图片说明](https://static.oschina.net/uploads/img/201908/27095258_M2Xq.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201904/14160957_hN3X.png "在这里输入图片标题")
##### UNIAPP效果
![](https://oscimg.oschina.net/oscnet/up-aac943fbd26561879c57a41f7a406edf274.png)
![](https://oscimg.oschina.net/oscnet/up-9a44ba2e82b09c750629d12fafd7f60f553.png)
##### 大屏设计器
![](https://oscimg.oschina.net/oscnet/up-402a6034124474bfef8dfc5b4b2bac1ce5c.png)
![](https://oscimg.oschina.net/oscnet/up-6f7ba2e2ebbeea0d203db8d69fd87644c9f.png)
![](https://oscimg.oschina.net/oscnet/up-ee8d34f318da466b8a6070a6e3111d12ce7.png)
![](https://oscimg.oschina.net/oscnet/up-6b81781b43086819049c4421206810667c5.png)
##### 流程设计
![](https://oscimg.oschina.net/oscnet/up-981ce174e4fbb48c8a2ce4ccfd7372e2994.png)
![](https://oscimg.oschina.net/oscnet/up-1dc0d052149ec675f3e4fad632b82b48add.png)
![](https://oscimg.oschina.net/oscnet/up-de31bc2f9d9b8332c554b0954cc73d79593.png)
![输入图片说明](https://static.oschina.net/uploads/img/201907/05165142_yyQ7.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201904/14160917_9Ftz.png "在这里输入图片标题")
![输入图片说明](https://static.oschina.net/uploads/img/201904/14160633_u59G.png "在这里输入图片标题")
##### 表单设计器
![](https://oscimg.oschina.net/oscnet/up-5f8cb657615714b02190b355e59f60c5937.png)
![](https://oscimg.oschina.net/oscnet/up-d9659b2f324e33218476ec98c9b400e6508.png)
![](https://oscimg.oschina.net/oscnet/up-4868615395272d3206dbb960ade02dbc291.png)
## 捐赠
如果觉得还不错,请作者喝杯咖啡吧 ☺
![](https://static.oschina.net/uploads/img/201903/08155608_0EFX.png)
### 流程引擎推荐
大家在使用本开源项目时,如果想进一步集成流程引擎,推荐结合贺波老师的书 [《深入Activiti流程引擎核心原理与高阶实战》](https://item.m.jd.com/product/13928958.html?gx=RnAomTM2bmCImZxDqYAkVCoIHuIYVqc)
<img src="https://jeecgos.oss-cn-beijing.aliyuncs.com/files/tuijian20231220161656.png" width="25%" height="auto">

View File

@@ -4,5 +4,6 @@ public interface ExperimentStatus {
String PRE_TEST = "试验前"; String PRE_TEST = "试验前";
String PROGRESSING = "试验进行中"; String PROGRESSING = "试验进行中";
String REPORT_AUDITING = "报告审批中";
String COMPLETED = "试验完成"; String COMPLETED = "试验完成";
} }

View File

@@ -16,6 +16,7 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.database.entity.Equipment; import org.jeecg.modules.database.entity.Equipment;
import org.jeecg.modules.database.service.IEquipmentService; import org.jeecg.modules.database.service.IEquipmentService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@@ -68,7 +69,13 @@ public class EquipmentController extends JeecgController<Equipment, IEquipmentSe
@RequiresPermissions("database:equipment:add") @RequiresPermissions("database:equipment:add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody Equipment equipment) { public Result<String> add(@RequestBody Equipment equipment) {
equipmentService.save(equipment); try {
equipmentService.save(equipment);
} catch (DuplicateKeyException e) {
return Result.error("设备已存在!");
} catch (Exception e) {
return Result.error("添加成失败!");
}
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }

View File

@@ -16,12 +16,8 @@ import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.util.JwtUtil; import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.modules.database.constant.ExperimentStatus; import org.jeecg.modules.database.constant.ExperimentStatus;
import org.jeecg.modules.database.entity.Experiment; import org.jeecg.modules.database.entity.*;
import org.jeecg.modules.database.entity.ExperimentAnnealProcess; import org.jeecg.modules.database.service.*;
import org.jeecg.modules.database.entity.ExperimentLog;
import org.jeecg.modules.database.service.IExperimentAnnealProcessService;
import org.jeecg.modules.database.service.IExperimentLogService;
import org.jeecg.modules.database.service.IExperimentService;
import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService; import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import java.util.Arrays; import java.util.Arrays;
import java.util.Objects;
/** /**
* @Description: 退火过程 * @Description: 退火过程
@@ -44,12 +41,11 @@ public class ExperimentAnnealProcessController extends JeecgController<Experimen
@Autowired @Autowired
private IExperimentAnnealProcessService experimentAnnealProcessService; private IExperimentAnnealProcessService experimentAnnealProcessService;
@Autowired @Autowired
private ISysUserService userService; private ISysUserService userService;
@Autowired @Autowired
private IExperimentService experimentService; private IExperimentService experimentService;
@Autowired @Autowired
private IExperimentLogService experimentLogService; private IExperimentLogService experimentLogService;
@@ -69,7 +65,8 @@ public class ExperimentAnnealProcessController extends JeecgController<Experimen
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<ExperimentAnnealProcess> queryWrapper = QueryGenerator.initQueryWrapper(experimentAnnealProcess, req.getParameterMap()); QueryWrapper<ExperimentAnnealProcess> queryWrapper = QueryGenerator.initQueryWrapper(experimentAnnealProcess,
req.getParameterMap());
Page<ExperimentAnnealProcess> page = new Page<ExperimentAnnealProcess>(pageNo, pageSize); Page<ExperimentAnnealProcess> page = new Page<ExperimentAnnealProcess>(pageNo, pageSize);
IPage<ExperimentAnnealProcess> pageList = experimentAnnealProcessService.page(page, queryWrapper); IPage<ExperimentAnnealProcess> pageList = experimentAnnealProcessService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
@@ -86,11 +83,17 @@ public class ExperimentAnnealProcessController extends JeecgController<Experimen
@RequiresPermissions("database:experiment_anneal_process:add") @RequiresPermissions("database:experiment_anneal_process:add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody ExperimentAnnealProcess experimentAnnealProcess, HttpServletRequest request) { public Result<String> add(@RequestBody ExperimentAnnealProcess experimentAnnealProcess, HttpServletRequest request) {
experimentAnnealProcessService.save(experimentAnnealProcess);
String experimentId = experimentAnnealProcess.getExperimentId(); String experimentId = experimentAnnealProcess.getExperimentId();
if (StringUtils.isBlank(experimentId)) { if (StringUtils.isBlank(experimentId)) {
return Result.error("试验数据不存在!"); return Result.error("试验数据不存在!");
} }
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
}
Experiment experiment = new Experiment(); Experiment experiment = new Experiment();
experiment.setId(experimentId); experiment.setId(experimentId);
experiment.setStatus(ExperimentStatus.PROGRESSING); experiment.setStatus(ExperimentStatus.PROGRESSING);
@@ -103,6 +106,8 @@ public class ExperimentAnnealProcessController extends JeecgController<Experimen
SysUser userByName = userService.getUserByName(username); SysUser userByName = userService.getUserByName(username);
experimentLog.setCreateBy(userByName.getRealname()); experimentLog.setCreateBy(userByName.getRealname());
experimentLogService.save(experimentLog); experimentLogService.save(experimentLog);
experimentAnnealProcessService.save(experimentAnnealProcess);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
@@ -117,16 +122,32 @@ public class ExperimentAnnealProcessController extends JeecgController<Experimen
@RequiresPermissions("database:experiment_anneal_process:edit") @RequiresPermissions("database:experiment_anneal_process:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody ExperimentAnnealProcess experimentAnnealProcess, HttpServletRequest request) { public Result<String> edit(@RequestBody ExperimentAnnealProcess experimentAnnealProcess, HttpServletRequest request) {
experimentAnnealProcessService.updateById(experimentAnnealProcess); ExperimentAnnealProcess byId = experimentAnnealProcessService.getById(experimentAnnealProcess.getId());
String experimentId = byId.getExperimentId();
if (StringUtils.isBlank(experimentId)) {
return Result.error("试验数据不存在!");
}
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
}
Experiment experiment = new Experiment();
experiment.setId(experimentId);
experiment.setStatus(ExperimentStatus.PROGRESSING);
experimentService.updateById(experiment);
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(experimentAnnealProcess.getExperimentId()); experimentLog.setExperimentId(experimentId);
experimentLog.setLogContent("编辑退火过程"); experimentLog.setLogContent("编辑退火过程");
String username = JwtUtil.getUserNameByToken(request); String username = JwtUtil.getUserNameByToken(request);
SysUser userByName = userService.getUserByName(username); SysUser userByName = userService.getUserByName(username);
experimentLog.setCreateBy(userByName.getRealname()); experimentLog.setCreateBy(userByName.getRealname());
experimentLogService.save(experimentLog); experimentLogService.save(experimentLog);
experimentAnnealProcessService.updateById(experimentAnnealProcess);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
@@ -141,15 +162,28 @@ public class ExperimentAnnealProcessController extends JeecgController<Experimen
@RequiresPermissions("database:experiment_anneal_process:delete") @RequiresPermissions("database:experiment_anneal_process:delete")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id, HttpServletRequest request) { public Result<String> delete(@RequestParam(name = "id", required = true) String id, HttpServletRequest request) {
experimentAnnealProcessService.removeById(id); ExperimentAnnealProcess experimentAnnealProcess = experimentAnnealProcessService.getById(id);
String experimentId = experimentAnnealProcess.getExperimentId();
if (StringUtils.isBlank(experimentId)) {
return Result.error("试验数据不存在!");
}
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
}
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(id); experimentLog.setExperimentId(experimentId);
experimentLog.setLogContent("删除退火过程"); experimentLog.setLogContent("删除退火过程");
String username = JwtUtil.getUserNameByToken(request); String username = JwtUtil.getUserNameByToken(request);
SysUser userByName = userService.getUserByName(username); SysUser userByName = userService.getUserByName(username);
experimentLog.setCreateBy(userByName.getRealname()); experimentLog.setCreateBy(userByName.getRealname());
experimentLogService.save(experimentLog); experimentLogService.save(experimentLog);
experimentAnnealProcessService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }

View File

@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import java.util.Arrays; import java.util.Arrays;
import java.util.Objects;
/** /**
* @Description: 辐照过程 * @Description: 辐照过程
@@ -83,11 +84,18 @@ public class ExperimentRadiationProcessController extends JeecgController<Experi
@RequiresPermissions("database:experiment_radiation_process:add") @RequiresPermissions("database:experiment_radiation_process:add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody ExperimentRadiationProcess experimentRadiationProcess, HttpServletRequest request) { public Result<String> add(@RequestBody ExperimentRadiationProcess experimentRadiationProcess, HttpServletRequest request) {
experimentRadiationProcessService.save(experimentRadiationProcess);
String experimentId = experimentRadiationProcess.getExperimentId(); String experimentId = experimentRadiationProcess.getExperimentId();
if (StringUtils.isBlank(experimentId)) { if (StringUtils.isBlank(experimentId)) {
return Result.error("试验数据不存在!"); return Result.error("试验数据不存在!");
} }
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
}
Experiment experiment = new Experiment(); Experiment experiment = new Experiment();
experiment.setId(experimentId); experiment.setId(experimentId);
experiment.setStatus(ExperimentStatus.PROGRESSING); experiment.setStatus(ExperimentStatus.PROGRESSING);
@@ -100,6 +108,8 @@ public class ExperimentRadiationProcessController extends JeecgController<Experi
SysUser userByName = userService.getUserByName(username); SysUser userByName = userService.getUserByName(username);
experimentLog.setCreateBy(userByName.getRealname()); experimentLog.setCreateBy(userByName.getRealname());
experimentLogService.save(experimentLog); experimentLogService.save(experimentLog);
experimentRadiationProcessService.save(experimentRadiationProcess);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
@@ -114,16 +124,31 @@ public class ExperimentRadiationProcessController extends JeecgController<Experi
@RequiresPermissions("database:experiment_radiation_process:edit") @RequiresPermissions("database:experiment_radiation_process:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody ExperimentRadiationProcess experimentRadiationProcess, HttpServletRequest request) { public Result<String> edit(@RequestBody ExperimentRadiationProcess experimentRadiationProcess, HttpServletRequest request) {
experimentRadiationProcessService.updateById(experimentRadiationProcess);
ExperimentRadiationProcess byId = experimentRadiationProcessService.getById(experimentRadiationProcess.getId()); ExperimentRadiationProcess byId = experimentRadiationProcessService.getById(experimentRadiationProcess.getId());
String experimentId = byId.getExperimentId();
if (StringUtils.isBlank(experimentId)) {
return Result.error("试验数据不存在!");
}
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
}
Experiment experiment = new Experiment();
experiment.setId(experimentId);
experiment.setStatus(ExperimentStatus.PROGRESSING);
experimentService.updateById(experiment);
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(byId.getExperimentId()); experimentLog.setExperimentId(experimentId);
experimentLog.setLogContent("编辑辐照过程"); experimentLog.setLogContent("编辑辐照过程");
String username = JwtUtil.getUserNameByToken(request); String username = JwtUtil.getUserNameByToken(request);
SysUser userByName = userService.getUserByName(username); SysUser userByName = userService.getUserByName(username);
experimentLog.setCreateBy(userByName.getRealname()); experimentLog.setCreateBy(userByName.getRealname());
experimentLogService.save(experimentLog); experimentLogService.save(experimentLog);
experimentRadiationProcessService.updateById(experimentRadiationProcess);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
@@ -139,16 +164,27 @@ public class ExperimentRadiationProcessController extends JeecgController<Experi
@RequiresPermissions("database:experiment_radiation_process:delete") @RequiresPermissions("database:experiment_radiation_process:delete")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id, HttpServletRequest request) { public Result<String> delete(@RequestParam(name = "id", required = true) String id, HttpServletRequest request) {
experimentRadiationProcessService.removeById(id); ExperimentRadiationProcess experimentRadiationProcess = experimentRadiationProcessService.getById(id);
ExperimentRadiationProcess byId = experimentRadiationProcessService.getById(id); String experimentId = experimentRadiationProcess.getExperimentId();
if (StringUtils.isBlank(experimentId)) {
return Result.error("试验数据不存在!");
}
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
}
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(byId.getExperimentId()); experimentLog.setExperimentId(experimentId);
experimentLog.setLogContent("删除辐照过程"); experimentLog.setLogContent("删除辐照过程");
String username = JwtUtil.getUserNameByToken(request); String username = JwtUtil.getUserNameByToken(request);
SysUser userByName = userService.getUserByName(username); SysUser userByName = userService.getUserByName(username);
experimentLog.setCreateBy(userByName.getRealname()); experimentLog.setCreateBy(userByName.getRealname());
experimentLogService.save(experimentLog); experimentLogService.save(experimentLog);
experimentRadiationProcessService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }

View File

@@ -268,12 +268,16 @@ public class ExperimentReportController extends JeecgController<ExperimentReport
} }
experimentReportService.updateById(report); experimentReportService.updateById(report);
Experiment experiment = new Experiment();
experiment.setId(report.getExperimentId());
if (StringUtils.equals(report.getStatus(), "PASSED")) { if (StringUtils.equals(report.getStatus(), "PASSED")) {
Experiment experiment = new Experiment();
experiment.setId(report.getExperimentId());
experiment.setStatus(ExperimentStatus.COMPLETED); experiment.setStatus(ExperimentStatus.COMPLETED);
experimentService.updateById(experiment); } else if (StringUtils.equals(report.getStatus(), "REJECT")) {
experiment.setStatus(ExperimentStatus.PROGRESSING);
} else {
experiment.setStatus(ExperimentStatus.REPORT_AUDITING);
} }
experimentService.updateById(experiment);
return Result.OK("审核成功!"); return Result.OK("审核成功!");
} }

View File

@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import java.util.Arrays; import java.util.Arrays;
import java.util.Objects;
/** /**
* @Description: 测试过程 * @Description: 测试过程
@@ -82,11 +83,17 @@ public class ExperimentTestProcessController extends JeecgController<ExperimentT
@RequiresPermissions("database:experiment_test_process:add") @RequiresPermissions("database:experiment_test_process:add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody ExperimentTestProcess experimentTestProcess, HttpServletRequest request) { public Result<String> add(@RequestBody ExperimentTestProcess experimentTestProcess, HttpServletRequest request) {
experimentTestProcessService.save(experimentTestProcess);
String experimentId = experimentTestProcess.getExperimentId(); String experimentId = experimentTestProcess.getExperimentId();
if (StringUtils.isBlank(experimentId)) { if (StringUtils.isBlank(experimentId)) {
return Result.error("试验数据不存在!"); return Result.error("试验数据不存在!");
} }
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
}
Experiment experiment = new Experiment(); Experiment experiment = new Experiment();
experiment.setId(experimentId); experiment.setId(experimentId);
experiment.setStatus(ExperimentStatus.PROGRESSING); experiment.setStatus(ExperimentStatus.PROGRESSING);
@@ -99,6 +106,9 @@ public class ExperimentTestProcessController extends JeecgController<ExperimentT
SysUser userByName = userService.getUserByName(username); SysUser userByName = userService.getUserByName(username);
experimentLog.setCreateBy(userByName.getRealname()); experimentLog.setCreateBy(userByName.getRealname());
experimentLogService.save(experimentLog); experimentLogService.save(experimentLog);
experimentTestProcessService.save(experimentTestProcess);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }
@@ -113,16 +123,33 @@ public class ExperimentTestProcessController extends JeecgController<ExperimentT
@RequiresPermissions("database:experiment_test_process:edit") @RequiresPermissions("database:experiment_test_process:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody ExperimentTestProcess experimentTestProcess, HttpServletRequest request) { public Result<String> edit(@RequestBody ExperimentTestProcess experimentTestProcess, HttpServletRequest request) {
experimentTestProcessService.updateById(experimentTestProcess);
ExperimentTestProcess byId = experimentTestProcessService.getById(experimentTestProcess.getId()); ExperimentTestProcess byId = experimentTestProcessService.getById(experimentTestProcess.getId());
String experimentId = byId.getExperimentId();
if (StringUtils.isBlank(experimentId)) {
return Result.error("试验数据不存在!");
}
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
}
Experiment experiment = new Experiment();
experiment.setId(experimentId);
experiment.setStatus(ExperimentStatus.PROGRESSING);
experimentService.updateById(experiment);
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(byId.getExperimentId()); experimentLog.setExperimentId(experimentId);
experimentLog.setLogContent("编辑测试过程"); experimentLog.setLogContent("编辑测试过程");
String username = JwtUtil.getUserNameByToken(request); String username = JwtUtil.getUserNameByToken(request);
SysUser userByName = userService.getUserByName(username); SysUser userByName = userService.getUserByName(username);
experimentLog.setCreateBy(userByName.getRealname()); experimentLog.setCreateBy(userByName.getRealname());
experimentLogService.save(experimentLog); experimentLogService.save(experimentLog);
experimentTestProcessService.updateById(experimentTestProcess);
return Result.OK("编辑成功!"); return Result.OK("编辑成功!");
} }
@@ -137,14 +164,29 @@ public class ExperimentTestProcessController extends JeecgController<ExperimentT
@RequiresPermissions("database:experiment_test_process:delete") @RequiresPermissions("database:experiment_test_process:delete")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id, HttpServletRequest request) { public Result<String> delete(@RequestParam(name = "id", required = true) String id, HttpServletRequest request) {
experimentTestProcessService.removeById(id); ExperimentTestProcess experimentTestProcess = experimentTestProcessService.getById(id);
String experimentId = experimentTestProcess.getExperimentId();
if (StringUtils.isBlank(experimentId)) {
return Result.error("试验数据不存在!");
}
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
}
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(id); experimentLog.setExperimentId(experimentId);
experimentLog.setLogContent("删除测试过程"); experimentLog.setLogContent("删除测试过程");
String username = JwtUtil.getUserNameByToken(request); String username = JwtUtil.getUserNameByToken(request);
SysUser userByName = userService.getUserByName(username); SysUser userByName = userService.getUserByName(username);
experimentLog.setCreateBy(userByName.getRealname()); experimentLog.setCreateBy(userByName.getRealname());
experimentLogService.save(experimentLog); experimentLogService.save(experimentLog);
experimentTestProcessService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }

View File

@@ -16,11 +16,10 @@ import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.util.JwtUtil; import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.modules.database.constant.ExperimentStatus;
import org.jeecg.modules.database.dto.ExperimentUserDTO; import org.jeecg.modules.database.dto.ExperimentUserDTO;
import org.jeecg.modules.database.entity.ExperimentLog; import org.jeecg.modules.database.entity.*;
import org.jeecg.modules.database.entity.ExperimentUser; import org.jeecg.modules.database.service.*;
import org.jeecg.modules.database.service.IExperimentLogService;
import org.jeecg.modules.database.service.IExperimentUserService;
import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService; import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -48,6 +47,9 @@ public class ExperimentUserController extends JeecgController<ExperimentUser, IE
@Autowired @Autowired
private ISysUserService userService; private ISysUserService userService;
@Autowired
private IExperimentService experimentService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@@ -99,6 +101,13 @@ public class ExperimentUserController extends JeecgController<ExperimentUser, IE
if (StringUtils.isBlank(experimentId)) { if (StringUtils.isBlank(experimentId)) {
return Result.error("试验数据不存在!"); return Result.error("试验数据不存在!");
} }
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
}
experimentUserService.save(experimentUser); experimentUserService.save(experimentUser);
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(experimentUser.getExperimentId()); experimentLog.setExperimentId(experimentUser.getExperimentId());
@@ -115,13 +124,21 @@ public class ExperimentUserController extends JeecgController<ExperimentUser, IE
@RequiresPermissions("database:experiment_user:add") @RequiresPermissions("database:experiment_user:add")
@PostMapping(value = "/batchAdd") @PostMapping(value = "/batchAdd")
public Result<String> batchAdd(@RequestBody List<ExperimentUser> experimentUserList, HttpServletRequest request) { public Result<String> batchAdd(@RequestBody List<ExperimentUser> experimentUserList, HttpServletRequest request) {
experimentUserList.forEach(v -> { for (ExperimentUser v : experimentUserList) {
String experimentId = v.getExperimentId(); String experimentId = v.getExperimentId();
if (StringUtils.isBlank(experimentId)) { if (StringUtils.isBlank(experimentId)) {
throw new RuntimeException("试验数据不存在!"); return Result.error("试验数据不存在!");
}
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
} }
experimentUserService.save(v); experimentUserService.save(v);
}); }
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(experimentUserList.get(0).getExperimentId()); experimentLog.setExperimentId(experimentUserList.get(0).getExperimentId());
experimentLog.setLogContent("添加试验人员"); experimentLog.setLogContent("添加试验人员");
@@ -145,7 +162,18 @@ public class ExperimentUserController extends JeecgController<ExperimentUser, IE
public Result<String> edit(@RequestBody ExperimentUser experimentUser, HttpServletRequest request) { public Result<String> edit(@RequestBody ExperimentUser experimentUser, HttpServletRequest request) {
experimentUserService.updateById(experimentUser); experimentUserService.updateById(experimentUser);
ExperimentUser byId = experimentUserService.getById(experimentUser.getId()); ExperimentUser byId = experimentUserService.getById(experimentUser.getId());
String experimentId = byId.getExperimentId();
if (StringUtils.isBlank(experimentId)) {
return Result.error("试验数据不存在!");
}
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
}
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(byId.getExperimentId()); experimentLog.setExperimentId(byId.getExperimentId());
experimentLog.setLogContent("编辑试验人员"); experimentLog.setLogContent("编辑试验人员");
@@ -167,15 +195,28 @@ public class ExperimentUserController extends JeecgController<ExperimentUser, IE
@RequiresPermissions("database:experiment_user:delete") @RequiresPermissions("database:experiment_user:delete")
@DeleteMapping(value = "/delete") @DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id, HttpServletRequest request) { public Result<String> delete(@RequestParam(name = "id", required = true) String id, HttpServletRequest request) {
experimentUserService.removeById(id); ExperimentUser experimentUser = experimentUserService.getById(id);
String experimentId = experimentUser.getExperimentId();
if (StringUtils.isBlank(experimentId)) {
return Result.error("试验数据不存在!");
}
Experiment dbExperiment = experimentService.getById(experimentId);
if (Objects.isNull(dbExperiment)) {
return Result.error("试验数据不存在!");
}
if (StringUtils.containsAny(dbExperiment.getStatus(), ExperimentStatus.COMPLETED, ExperimentStatus.REPORT_AUDITING)) {
return Result.error("试验状态:[" + dbExperiment.getStatus() + "]不能进行修改!");
}
ExperimentLog experimentLog = new ExperimentLog(); ExperimentLog experimentLog = new ExperimentLog();
experimentLog.setExperimentId(id); experimentLog.setExperimentId(experimentId);
experimentLog.setLogContent("删除试验人员"); experimentLog.setLogContent("删除试验人员");
String username = JwtUtil.getUserNameByToken(request); String username = JwtUtil.getUserNameByToken(request);
SysUser userByName = userService.getUserByName(username); SysUser userByName = userService.getUserByName(username);
experimentLog.setCreateBy(userByName.getRealname()); experimentLog.setCreateBy(userByName.getRealname());
experimentLogService.save(experimentLog); experimentLogService.save(experimentLog);
experimentUserService.removeById(id);
return Result.OK("删除成功!"); return Result.OK("删除成功!");
} }
@@ -245,8 +286,6 @@ public class ExperimentUserController extends JeecgController<ExperimentUser, IE
return Result.OK(userDTOList); return Result.OK(userDTOList);
} }
/** /**
* 导出excel * 导出excel
* *

View File

@@ -1,19 +1,22 @@
package org.jeecg.modules.database.entity; package org.jeecg.modules.database.entity;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.database.constant.ExperimentStatus; import org.jeecg.modules.database.constant.ExperimentStatus;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.*;
import java.util.Objects;
/** /**
* @Description: 试验管理 * @Description: 试验管理
@@ -170,6 +173,28 @@ public class Experiment implements Serializable {
public Experiment copy() { public Experiment copy() {
Experiment experiment = new Experiment(); Experiment experiment = new Experiment();
BeanUtil.copyProperties(this, experiment); BeanUtil.copyProperties(this, experiment);
String irradiationBoard = this.getIrradiationBoard();
//[{"key":"1","sampleModel":"88h21","irradiationBoardNumber":"20","irradiationBoardCode":"293",
// "measurementValidity":"2024-11-09","sourceArea":"20"}]
if (StringUtils.isNotBlank(irradiationBoard)) {
List<JSONObject> boardList = JSON.parseArray(irradiationBoard, JSONObject.class);
boardList.forEach(board -> {
board.put("measurementValidity", null);
board.put("sourceArea", null);
});
experiment.setIrradiationBoard(JSON.toJSONString(boardList));
}
String deviationEquipment = this.getDeviationEquipment();
//[{"key":"1","sampleModel":"88h21","equipmentModel":"siis","offsetCondition":"sjjsj","load":"2024-11-09",
// "equipmentType":"sjjsjsj"}]
if (StringUtils.isNotBlank(deviationEquipment)) {
List<JSONObject> boardList = JSON.parseArray(deviationEquipment, JSONObject.class);
boardList.forEach(board -> {
board.put("load", null);
});
experiment.setDeviationEquipment(JSON.toJSONString(boardList));
}
experiment.setExperimentNo("NO-" + DateUtils.formatDate(new Date(), "yyyyMMddHHmmss"));
experiment.setName(this.name + "-" + getCopyCount()); experiment.setName(this.name + "-" + getCopyCount());
experiment.setId(null); experiment.setId(null);
experiment.setCopyCount(0); experiment.setCopyCount(0);