diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger2Config.java b/jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger2Config.java index 92e962e..d6fc29f 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/config/Swagger2Config.java +++ b/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() diff --git a/jeecg-module-activit/pom.xml b/jeecg-module-activit/pom.xml new file mode 100644 index 0000000..8365550 --- /dev/null +++ b/jeecg-module-activit/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + + org.jeecgframework.boot + jeecg-boot-parent + 3.6.1 + + + jeecg-module-activit + pom + + + org.jeecgframework.boot + jeecg-boot-base-core + + + org.activiti + activiti-spring-boot-starter + + + + mybatis + org.mybatis + + + + + + + + \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java index 9fb9dcf..b5fb57a 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysUserController.java +++ b/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 userRegister(@RequestBody JSONObject jsonObject, SysUser user) { Result result = new Result(); 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 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 queryWrapper = new QueryWrapper(); + 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("注册失败"); } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysUser.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysUser.java index 52d03d9..1c42398 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/entity/SysUser.java +++ b/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; } diff --git a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java b/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java index 633249d..49f629a 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java +++ b/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 { diff --git a/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml b/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml index 805c041..288375b 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml +++ b/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 diff --git a/jeecg-module-system/jeecg-system-start/src/main/resources/application.yml b/jeecg-module-system/jeecg-system-start/src/main/resources/application.yml index 67562f1..e51c6c5 100644 --- a/jeecg-module-system/jeecg-system-start/src/main/resources/application.yml +++ b/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@' \ No newline at end of file diff --git a/pom.xml b/pom.xml index 135ee47..6bcd097 100644 --- a/pom.xml +++ b/pom.xml @@ -8,17 +8,9 @@ - 北京国炬信息技术有限公司 - jeecgos@163.com - http://www.guojusoft.com + 湖州市公立医院改革与高质量发展项目管理平台 - - - http://www.jeecg.com - http://guojusoft.com - http://www.jeecg.com/vip - org.springframework.boot @@ -81,7 +73,8 @@ jeecg-boot-base-core jeecg-module-demo jeecg-module-system - + jeecg-module-activit + @@ -389,6 +382,19 @@ jimureport-nosql-starter 1.6.0 + + org.activiti + activiti-spring-boot-starter + 7.0.0.Beta2 + + + + mybatis + org.mybatis + + + +