diff --git a/nladmin-system/nlsso-server/pom.xml b/nladmin-system/nlsso-server/pom.xml
index 244d963..c39fc8a 100644
--- a/nladmin-system/nlsso-server/pom.xml
+++ b/nladmin-system/nlsso-server/pom.xml
@@ -41,9 +41,15 @@
${hutool.version}
-
+
+
+
+ org.springframework
+ spring-jdbc
+ 5.2.9.RELEASE
@@ -385,6 +391,16 @@
httpclient
4.5.13
+
+ jakarta.transaction
+ jakarta.transaction-api
+ 1.3.3
+
+
+ jakarta.persistence
+ jakarta.persistence-api
+ 2.2.3
+
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java b/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java
index 055d52c..230144d 100644
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java
+++ b/nladmin-system/nlsso-server/src/main/java/org/nl/AppRun.java
@@ -13,7 +13,6 @@ import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
-import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.bind.annotation.GetMapping;
@@ -34,7 +33,6 @@ import org.springframework.web.bind.annotation.RestController;
})
@ServletComponentScan //https://blog.csdn.net/qq_36850813/article/details/101194250
@EnableTransactionManagement
-@EnableJpaAuditing(auditorAwareRef = "auditorAware")
@EnableMethodCache(basePackages = "org.nl")
@EnableCreateCacheAnnotation
@ComponentScan(
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/modules/common/base/BaseEntity.java b/nladmin-system/nlsso-server/src/main/java/org/nl/modules/common/base/BaseEntity.java
deleted file mode 100644
index 08fc74e..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/modules/common/base/BaseEntity.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright 2019-2020 Zheng Jie
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.nl.modules.common.base;
-
-import com.alibaba.fastjson.annotation.JSONField;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.data.annotation.CreatedBy;
-import org.springframework.data.annotation.LastModifiedBy;
-import org.springframework.data.jpa.domain.support.AuditingEntityListener;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import javax.persistence.Column;
-import javax.persistence.EntityListeners;
-import javax.persistence.MappedSuperclass;
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * 通用字段, is_del 根据需求自行添加
- * @author Zheng Jie
- * @Date 2019年10月24日20:46:32
- */
-@Getter
-@Setter
-@MappedSuperclass
-@EntityListeners(AuditingEntityListener.class)
-public class BaseEntity implements Serializable {
-
- @CreatedBy
- @Column(name = "create_name", updatable = false)
- @ApiModelProperty(value = "创建人", hidden = true)
- private String create_name;
-
- private Long create_id;
-
- @LastModifiedBy
- @Column(name = "update_optname")
- @ApiModelProperty(value = "更新人", hidden = true)
- private String update_optname;
-
- private Long update_optid;
-
- @Column(name = "create_time", updatable = false)
- @ApiModelProperty(value = "创建时间", hidden = true)
- @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- @JSONField(format="yyyy-MM-dd HH:mm:ss")
- private Date create_time;
-
- @Column(name = "update_time")
- @ApiModelProperty(value = "更新时间", hidden = true)
- @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
- @JSONField(format="yyyy-MM-dd HH:mm:ss")
- private Date update_time;
-
- /* 分组校验 */
- public @interface Create {}
-
- /* 分组校验 */
- public @interface Update {}
-
- /*@Override
- public String toString() {
- ToStringBuilder builder = new ToStringBuilder(this);
- Field[] fields = this.getClass().getDeclaredFields();
- try {
- for (Field f : fields) {
- f.setAccessible(true);
- builder.append(f.getName(), f.get(this)).append("\n");
- }
- } catch (Exception e) {
- builder.append("toString builder encounter an error");
- }
- return builder.toString();
- }*/
-}
diff --git a/nladmin-system/nlsso-server/src/main/java/org/nl/modules/common/utils/QueryHelp.java b/nladmin-system/nlsso-server/src/main/java/org/nl/modules/common/utils/QueryHelp.java
deleted file mode 100644
index 3403048..0000000
--- a/nladmin-system/nlsso-server/src/main/java/org/nl/modules/common/utils/QueryHelp.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright 2019-2020 Zheng Jie
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.nl.modules.common.utils;
-
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.nl.modules.common.annotation.DataPermission;
-import org.nl.modules.common.annotation.Query;
-
-import javax.persistence.criteria.*;
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * @author Zheng Jie
- * @date 2019-6-4 14:59:48
- */
-@Slf4j
-@SuppressWarnings({"unchecked","all"})
-public class QueryHelp {
-
- public static Predicate getPredicate(Root root, Q query, CriteriaBuilder cb) {
- List list = new ArrayList<>();
- if(query == null){
- return cb.and(list.toArray(new Predicate[0]));
- }
- // 数据权限验证
- DataPermission permission = query.getClass().getAnnotation(DataPermission.class);
- if(permission != null){
- // 获取数据权限
-// List dataScopes = SecurityUtils.getCurrentUserDataScope();
- List dataScopes = new ArrayList<>();
- if(CollectionUtil.isNotEmpty(dataScopes)){
- if(StrUtil.isNotEmpty(permission.joinName()) && StrUtil.isNotEmpty(permission.fieldName())) {
- Join join = root.join(permission.joinName(), JoinType.LEFT);
- list.add(getExpression(permission.fieldName(),join, root).in(dataScopes));
- } else if (StrUtil.isEmpty(permission.joinName()) && StrUtil.isNotEmpty(permission.fieldName())) {
- list.add(getExpression(permission.fieldName(),null, root).in(dataScopes));
- }
- }
- }
- try {
- List fields = getAllFields(query.getClass(), new ArrayList<>());
- for (Field field : fields) {
- boolean accessible = field.isAccessible();
- // 设置对象的访问权限,保证对private的属性的访
- field.setAccessible(true);
- Query q = field.getAnnotation(Query.class);
- if (q != null) {
- String propName = q.propName();
- String joinName = q.joinName();
- String blurry = q.blurry();
- String attributeName = isBlank(propName) ? field.getName() : propName;
- Class> fieldType = field.getType();
- Object val = field.get(query);
- if (ObjectUtil.isNull(val) || "".equals(val)) {
- continue;
- }
- Join join = null;
- // 模糊多字段
- if (ObjectUtil.isNotEmpty(blurry)) {
- String[] blurrys = blurry.split(",");
- List orPredicate = new ArrayList<>();
- for (String s : blurrys) {
- orPredicate.add(cb.like(root.get(s)
- .as(String.class), "%" + val.toString() + "%"));
- }
- Predicate[] p = new Predicate[orPredicate.size()];
- list.add(cb.or(orPredicate.toArray(p)));
- continue;
- }
- if (ObjectUtil.isNotEmpty(joinName)) {
- String[] joinNames = joinName.split(">");
- for (String name : joinNames) {
- switch (q.join()) {
- case LEFT:
- if(ObjectUtil.isNotNull(join) && ObjectUtil.isNotNull(val)){
- join = join.join(name, JoinType.LEFT);
- } else {
- join = root.join(name, JoinType.LEFT);
- }
- break;
- case RIGHT:
- if(ObjectUtil.isNotNull(join) && ObjectUtil.isNotNull(val)){
- join = join.join(name, JoinType.RIGHT);
- } else {
- join = root.join(name, JoinType.RIGHT);
- }
- break;
- case INNER:
- if(ObjectUtil.isNotNull(join) && ObjectUtil.isNotNull(val)){
- join = join.join(name, JoinType.INNER);
- } else {
- join = root.join(name, JoinType.INNER);
- }
- break;
- default: break;
- }
- }
- }
- switch (q.type()) {
- case EQUAL:
- list.add(cb.equal(getExpression(attributeName,join,root)
- .as((Class extends Comparable>) fieldType),val));
- break;
- case GREATER_THAN:
- list.add(cb.greaterThanOrEqualTo(getExpression(attributeName,join,root)
- .as((Class extends Comparable>) fieldType), (Comparable) val));
- break;
- case LESS_THAN:
- list.add(cb.lessThanOrEqualTo(getExpression(attributeName,join,root)
- .as((Class extends Comparable>) fieldType), (Comparable) val));
- break;
- case LESS_THAN_NQ:
- list.add(cb.lessThan(getExpression(attributeName,join,root)
- .as((Class extends Comparable>) fieldType), (Comparable) val));
- break;
- case INNER_LIKE:
- list.add(cb.like(getExpression(attributeName,join,root)
- .as(String.class), "%" + val.toString() + "%"));
- break;
- case LEFT_LIKE:
- list.add(cb.like(getExpression(attributeName,join,root)
- .as(String.class), "%" + val.toString()));
- break;
- case RIGHT_LIKE:
- list.add(cb.like(getExpression(attributeName,join,root)
- .as(String.class), val.toString() + "%"));
- break;
- case IN:
- if (CollUtil.isNotEmpty((Collection)val)) {
- list.add(getExpression(attributeName,join,root).in((Collection) val));
- }
- break;
- case NOT_EQUAL:
- list.add(cb.notEqual(getExpression(attributeName,join,root), val));
- break;
- case NOT_NULL:
- list.add(cb.isNotNull(getExpression(attributeName,join,root)));
- break;
- case IS_NULL:
- list.add(cb.isNull(getExpression(attributeName,join,root)));
- break;
- case BETWEEN:
- List