Browse Source

提交

master
zhouhaibin 8 months ago
parent
commit
91022b163e
  1. 14
      jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger2Config.java
  2. 34
      jeecg-module-activit/pom.xml
  3. 54
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java
  4. 10
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysUser.java
  5. 7
      jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java
  6. 140
      jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml
  7. 2
      jeecg-module-system/jeecg-system-start/src/main/resources/application.yml
  8. 26
      pom.xml

14
jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger2Config.java

@ -56,6 +56,19 @@ public class Swagger2Config implements WebMvcConfigurer {
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
}
@Bean(value = "activitiApi2")
public Docket activitiApi() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("webApi")
.apiInfo(apiInfo())
.select()
//这一句可加可不加,该配置可以扫描所有有ApiOperation注解的api,用这种方式更灵活
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.paths(PathSelectors.any())
.build();
}
/**
* swagger2的配置文件这里可以配置swagger2的一些基本的内容比如扫描的包等等
@ -70,7 +83,6 @@ public class Swagger2Config implements WebMvcConfigurer {
//此包路径下的类,才生成接口文档
.apis(RequestHandlerSelectors.basePackage("org.jeecg"))
//加了ApiOperation注解的类,才生成接口文档
.apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.paths(PathSelectors.any())
.build()

34
jeecg-module-activit/pom.xml

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-parent</artifactId>
<version>3.6.1</version>
</parent>
<artifactId>jeecg-module-activit</artifactId>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-base-core</artifactId>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<!-- 重点坑,不排除mybatis的话,在启动项目时会报错mybatisplus缺少类 -->
<artifactId>mybatis</artifactId>
<groupId>org.mybatis</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>

54
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java

@ -9,6 +9,7 @@ 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.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
@ -100,7 +101,10 @@ public class SysUserController {
@Autowired
private ISysUserTenantService userTenantService;
@Autowired
private ISysDictService sysDictService;
@Autowired
private ISysRoleService sysRoleService;
/**
* 获取租户下用户数据支持租户隔离
* @param user
@ -945,7 +949,8 @@ public class SysUserController {
public Result<JSONObject> userRegister(@RequestBody JSONObject jsonObject, SysUser user) {
Result<JSONObject> result = new Result<JSONObject>();
String phone = jsonObject.getString("phone");
String smscode = jsonObject.getString("smscode");
//手机验证码先不用
// String smscode = jsonObject.getString("smscode");
//update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
String redisKey = CommonConstant.PHONE_REDIS_KEY_PRE+phone;
@ -953,7 +958,8 @@ public class SysUserController {
//update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906
String username = jsonObject.getString("username");
//未设置用户名,则用手机号作为用户名
String workplaceType = jsonObject.getString("workplaceType");
//未设置用户名,则用手机号作为用户名
if(oConvertUtils.isEmpty(username)){
username = phone;
}
@ -984,16 +990,16 @@ public class SysUserController {
return result;
}
}
if(null == code){
result.setMessage("手机验证码失效,请重新获取");
result.setSuccess(false);
return result;
}
if (!smscode.equals(code.toString())) {
result.setMessage("手机验证码错误");
result.setSuccess(false);
return result;
}
// if(null == code){
// result.setMessage("手机验证码失效,请重新获取");
// result.setSuccess(false);
// return result;
// }
// if (!smscode.equals(code.toString())) {
// result.setMessage("手机验证码错误");
// result.setSuccess(false);
// return result;
// }
String realname = jsonObject.getString("realname");
if(oConvertUtils.isEmpty(realname)){
@ -1010,11 +1016,31 @@ public class SysUserController {
user.setPassword(passwordEncode);
user.setEmail(email);
user.setPhone(phone);
user.setWorkplace(jsonObject.getString("workplace"));
user.setWorkplaceType(workplaceType);
user.setStatus(CommonConstant.USER_UNFREEZE);
user.setDelFlag(CommonConstant.DEL_FLAG_0);
user.setActivitiSync(CommonConstant.ACT_SYNC_1);
sysUserService.addUserWithRole(user,"");//默认临时角色 test
result.success("注册成功");
//添加角色信息
String sysUserId = user.getId();
//获取角色姓名
String workplaceName = sysDictService.queryDictTextByKey("workplaceType", workplaceType);
LambdaQueryWrapper<SysRole> queryRoleByName = new LambdaQueryWrapper<>();
queryRoleByName.eq(SysRole::getRoleName,workplaceName);
SysRole sysRole = sysRoleService.getOne(queryRoleByName);
if(sysRole==null){
return result.error500("当前单位角色不存在请联系管理员,注册失败");
}
String sysRoleId = sysRole.getId();
SysUserRole sysUserRole = new SysUserRole(sysUserId,sysRoleId);
QueryWrapper<SysUserRole> queryWrapper = new QueryWrapper<SysUserRole>();
queryWrapper.eq("role_id", sysRoleId).eq("user_id",sysUserId);
SysUserRole one = sysUserRoleService.getOne(queryWrapper);
if(one==null){
sysUserRoleService.save(sysUserRole);
}
result.success("注册成功");
} catch (Exception e) {
result.error500("注册失败");
}

10
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysUser.java

@ -211,4 +211,14 @@ public class SysUser implements Serializable {
*/
@TableField(exist = false)
private boolean izBindThird;
/**
* 单位
*/
private String workplace;
/**
* 单位类型身份
*/
private String workplaceType;
}

7
jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java

@ -3,7 +3,10 @@ package org.jeecg;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.oConvertUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ConfigurableApplicationContext;
@ -17,7 +20,9 @@ import java.net.UnknownHostException;
* 报错提醒: 未集成mongo报错可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class}
*/
@Slf4j
@SpringBootApplication
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, SecurityAutoConfiguration.class,
SecurityAutoConfiguration.class,
ManagementWebSecurityAutoConfiguration.class})
//@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class})
public class JeecgSystemApplication extends SpringBootServletInitializer {

140
jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml

@ -7,7 +7,7 @@ server:
include-stacktrace: ALWAYS
include-message: ALWAYS
servlet:
context-path: /jeecg-boot
context-path: /jeecg-boot #可以修改
compression:
enabled: true
min-response-size: 1024
@ -24,17 +24,29 @@ spring:
multipart:
max-file-size: 10MB
max-request-size: 10MB
mail:
host: smtp.163.com
username: jeecgos@163.com
password: ??
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
activiti:
#1.flase:默认值。activiti在启动时,对比数据库表中保存的版本,如果没有表或者版本不匹配,将抛出异常
#2.true: activiti会对数据库中所有表进行更新操作。如果表不存在,则自动创建
#3.create_drop: 在activiti启动时创建表,在关闭时删除表(必须手动关闭引擎,才能删除表)
#4.drop-create: 在activiti启动时删除原来的旧表,然后在创建新表(不需要手动关闭引擎)
database-schema-update: true
# 检测历史信息表是否存在,activiti7默认不生成历史信息表,开启历史表
db-history-used: true
# 历史记录存储等级
history-level: full
check-process-definitions: true
# 通过配置邮件服务器的相关信息,你可以在应用程序中发送邮件,例如发送验证码、通知等。
# mail:
# host: smtp.163.com
# username: jeecgos@163.com
# password: ??
# properties:
# mail:
# smtp:
# auth: true
# starttls:
# enable: true
# required: true
## quartz定时任务,采用数据库方式
quartz:
job-store-type: jdbc
@ -55,7 +67,7 @@ spring:
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: true
isClustered: false
misfireThreshold: 12000
clusterCheckinInterval: 15000
threadPool:
@ -133,9 +145,9 @@ spring:
slow-sql-millis: 5000
datasource:
master:
url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
username: root
password: c83086775
password: root
driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置
#multi-datasource1:
@ -193,34 +205,34 @@ jeecg:
shiro:
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/jmreport/bigscreen2/**
#阿里云oss存储和大鱼短信秘钥配置
oss:
accessKey: ??
secretKey: ??
endpoint: oss-cn-beijing.aliyuncs.com
bucketName: jeecgdev
# ElasticSearch 6设置
elasticsearch:
cluster-name: jeecg-ES
cluster-nodes: 127.0.0.1:9200
check-enabled: false
# oss:
# accessKey: ??
# secretKey: ??
# endpoint: oss-cn-beijing.aliyuncs.com
# bucketName: jeecgdev
# # ElasticSearch 6设置
# elasticsearch:
# cluster-name: jeecg-ES
# cluster-nodes: 127.0.0.1:9200
# check-enabled: false
# 在线预览文件服务器地址配置
file-view-domain: http://fileview.jeecg.com
# minio文件上传
minio:
minio_url: http://minio.jeecg.com
minio_name: ??
minio_pass: ??
bucketName: otatest
# # minio文件上传
# minio:
# minio_url: http://minio.jeecg.com
# minio_name: ??
# minio_pass: ??
# bucketName: otatest
#大屏报表参数设置
jmreport:
#多租户模式,默认值为空(created:按照创建人隔离、tenant:按照租户隔离) (v1.6.2+ 新增)
saasMode:
# 平台上线安全配置(v1.6.2+ 新增)
firewall:
# 数据源安全 (开启后,不允许使用平台数据源、SQL解析加签并且不允许查询数据库)
dataSourceSafe: false
# 低代码开发模式(dev:开发模式,prod:发布模式—关闭在线报表设计功能,分配角色admin、lowdeveloper可以放开限制)
lowCodeMode: dev
# jmreport:
# #多租户模式,默认值为空(created:按照创建人隔离、tenant:按照租户隔离) (v1.6.2+ 新增)
# saasMode:
# # 平台上线安全配置(v1.6.2+ 新增)
# firewall:
# # 数据源安全 (开启后,不允许使用平台数据源、SQL解析加签并且不允许查询数据库)
# dataSourceSafe: false
# # 低代码开发模式(dev:开发模式,prod:发布模式—关闭在线报表设计功能,分配角色admin、lowdeveloper可以放开限制)
# lowCodeMode: dev
#xxl-job配置
xxljob:
enabled: false
@ -256,27 +268,27 @@ knife4j:
username: jeecg
password: jeecg1314
#第三方登录
justauth:
enabled: true
type:
GITHUB:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/github/callback
WECHAT_ENTERPRISE:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_enterprise/callback
agent-id: ??
DINGTALK:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/dingtalk/callback
WECHAT_OPEN:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_open/callback
cache:
type: default
prefix: 'demo::'
timeout: 1h
#justauth:
# enabled: true
# type:
# GITHUB:
# client-id: ??
# client-secret: ??
# redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/github/callback
# WECHAT_ENTERPRISE:
# client-id: ??
# client-secret: ??
# redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_enterprise/callback
# agent-id: ??
# DINGTALK:
# client-id: ??
# client-secret: ??
# redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/dingtalk/callback
# WECHAT_OPEN:
# client-id: ??
# client-secret: ??
# redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_open/callback
# cache:
# type: default
# prefix: 'demo::'
# timeout: 1h

2
jeecg-module-system/jeecg-system-start/src/main/resources/application.yml

@ -1,5 +1,5 @@
spring:
application:
name: jeecg-system
name: 湖州市公立医院改革与高质量发展项目管理平台
profiles:
active: '@profile.name@'

26
pom.xml

@ -8,17 +8,9 @@
<developers>
<developer>
<name>北京国炬信息技术有限公司</name>
<email>jeecgos@163.com</email>
<url>http://www.guojusoft.com</url>
<name>湖州市公立医院改革与高质量发展项目管理平台</name>
</developer>
</developers>
<scm>
<connection>http://www.jeecg.com</connection>
<developerConnection>http://guojusoft.com</developerConnection>
<url>http://www.jeecg.com/vip</url>
</scm>
<parent>
<groupId>org.springframework.boot</groupId>
@ -81,7 +73,8 @@
<module>jeecg-boot-base-core</module>
<module>jeecg-module-demo</module>
<module>jeecg-module-system</module>
</modules>
<module>jeecg-module-activit</module>
</modules>
<repositories>
<repository>
@ -389,6 +382,19 @@
<artifactId>jimureport-nosql-starter</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring-boot-starter</artifactId>
<version>7.0.0.Beta2</version>
<exclusions>
<exclusion>
<!-- 重点坑,不排除mybatis的话,在启动项目时会报错mybatisplus缺少类 -->
<artifactId>mybatis</artifactId>
<groupId>org.mybatis</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>

Loading…
Cancel
Save