---初始化项目

This commit is contained in:
2025-10-10 09:20:48 +08:00
parent a8e0f1c377
commit 7f74c186da
203 changed files with 14674 additions and 0 deletions

View File

@ -0,0 +1,118 @@
<?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>com.geg</groupId>
<artifactId>itc-pcitc-dependencies</artifactId>
<version>${revision}</version>
</parent>
<artifactId>itc-pcitc-dependencies-api</artifactId>
<name>itc-pcitc-dependencies-api</name>
<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<revision>2.0.4</revision>
</properties>
<dependencies>
<dependency>
<groupId>com.geg</groupId>
<artifactId>itc-ms-common-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.geg</groupId>
<artifactId>itc-ms-user-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.geg</groupId>
<artifactId>itc-ms-workflow-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
</dependency>
<dependency>
<groupId>org.ssssssss</groupId>
<artifactId>magic-api-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<groupId>me.zhyd.oauth</groupId>
<artifactId>JustAuth</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.yml</include>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.yml</include>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.vm</include>
<include>**/*.ftl</include>
<include>**/*.jpg</include>
<include>**/*.png</include>
<include>**/*.xls</include>
<include>**/*.xlsx</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
</project>

View File

@ -0,0 +1,7 @@
package com.pictc.annotations.datalog;
public enum JoinCaseType {
FULL,NONE
}

View File

@ -0,0 +1,13 @@
package com.pictc.annotations.datalog;
/**
* @author 张福财
* @date 2025年8月28日 下午6:00:10
* @Description: 关联类型 ONE_ONE ONE_MANY
*/
public enum JoinType {
ONE,
MANY
}

View File

@ -0,0 +1,13 @@
package com.pictc.annotations.datalog;
/**
* @author 张福财
* @date 2025年8月26日 上午9:18:35
* @Description: 关联值类型
*/
public enum JoinValueType {
FEILD, //字段关联
STATIC //字段等于静态值
}

View File

@ -0,0 +1,41 @@
package com.pictc.annotations.datalog;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
/**
* @author 张福财
* @date 2025年8月26日 下午5:33:01
* @Description: 数据日志属性配置
*/
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface LogField {
@AliasFor("name")
String value() default "";
/**
* @Description: 业务名称
* @return String 返回类型
*/
@AliasFor("value")
String name() default "";
/**
* @Description: 数据库字段
* @return String 返回类型
*/
String column() default "";
/**
* @Description: 位置
* @return int 返回类型
*/
int index() default 0;
}

View File

@ -0,0 +1,63 @@
package com.pictc.annotations.datalog;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @author 张福财
* @date 2025年8月26日 上午9:37:23
* @Description: 关联关系
*/
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface LogJoin {
/**
* @Description: 业务名称
* @return String 返回类型
*/
String name();
/**
* @Description: 关联对象
* @return Class<?> 返回类型
*/
Class<?> target();
/**
* @Description: 关联类型
* @return JoinType 返回类型
*/
JoinType type();
/**
* @Description: 级联类型DEL(删除)、UPD(修改)、FULL(全部);
* @return JoinType 返回类型
*/
JoinCaseType caseType() default JoinCaseType.FULL;
/**
* @Description: 关联列
* @return DataLogJoinColumn[] 返回类型
*/
LogJoinColumn[] columns() default {};
/**
* @Description: 数据来源默认通过target配置的表名去关联查询如果sourceType = TQ 时配置查询ID
* @return String 返回类型
*/
String source() default "";
/**
* @Description: TODO(这里用一句话描述这个方法的作用)
* @return
* @return QJoinSource 返回类型
*/
SourceType sourceType() default SourceType.TABLE;
}

View File

@ -0,0 +1,48 @@
package com.pictc.annotations.datalog;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @author 张福财
* @date 2025年8月26日 上午9:37:45
* @Description: 关联属性配置
*/
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface LogJoinColumn {
/**
* @Description: 属性
* @return String 返回类型
*/
String field() default "";
/**
* @Description: 关联属性
* @return String 返回类型
*/
String relatedField() default "";
/**
* @Description: 赋值方向
* @return ValueDirectionType 返回类型
*/
ValueDirectionType valueDirection() default ValueDirectionType.LEFT;
/**
* @Description: 关联值类型JoinValueType FEILD【字段关联】、STATIC【字段等于静态值】
* @return String 返回类型
*/
JoinValueType valueType() default JoinValueType.FEILD;
String staticValue() default "";
Class<?> staticType() default String.class;
}

View File

@ -0,0 +1,48 @@
package com.pictc.annotations.datalog;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.core.annotation.AliasFor;
/**
* @author 张福财
* @date 2025年8月25日 下午6:09:03
* @Description: TODO(这里用一句话描述这个类的作用)
*/
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface LogTable {
/**
* @Description: 业务名称
* @return String 返回类型
*/
@AliasFor("name")
String value() default "";
/**
* @Description: 业务名称
* @return String 返回类型
*/
@AliasFor("value")
String name() default "";
/**
* @Description: 表名或者查询ID
* @return String 返回类型
*/
String source();
/**
* @Description:
* @return QJoinSource 返回类型
*/
SourceType sourceType() default SourceType.TABLE;
}

View File

@ -0,0 +1,13 @@
package com.pictc.annotations.datalog;
/**
* @author 张福财
* @date 2025年8月28日 下午4:24:27
* @Description: 数据来源默认从关联表获取从SQL配置表
*/
public enum SourceType {
TABLE,
TSQL
}

View File

@ -0,0 +1,13 @@
package com.pictc.annotations.datalog;
/**
* @author 张福财
* @date 2025年8月28日 下午2:40:03
* @Description: 赋值方向
* 左边为主表
* 右边为子表
*/
public enum ValueDirectionType {
LEFT, //向左
RIGHT
}

View File

@ -0,0 +1,115 @@
package com.pictc.common.mybatis;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;
import org.apache.ibatis.type.JdbcType;
import org.apache.ibatis.type.MappedJdbcTypes;
import org.apache.ibatis.type.MappedTypes;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;
@MappedTypes({Object.class})
@MappedJdbcTypes(JdbcType.VARCHAR)
public class JsonTypeHandler<T> extends AbstractJsonTypeHandler<Object> {
private boolean list;
private Class<?> entityClass;
public JsonTypeHandler(Class<?> type) {
list = isList(type);
}
public JsonTypeHandler(Class<?> type, Field field) {
list = isList(type);
try {
entityClass = getFeildFanClass(field, 0);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
@Override
public Object parse(String json) {
if(list) {
return JSON.parseArray(json,entityClass);
}
return JSON.parseObject(json,entityClass);
}
@Override
public String toJson(Object obj) {
if(obj==null) return null;
return JSON.toJSONString(obj, SerializerFeature.WriteMapNullValue,
SerializerFeature.WriteNullListAsEmpty, SerializerFeature.WriteNullStringAsEmpty);
}
/**
* 是否是list集合
* */
private boolean isList(Class<?> klass) {
return hashClass(klass, List.class);
}
/**
* klass是否实现了face类或接口
* @author tanuki
* @param klass 要判断的类型
* @param face 指定的类型
* */
private boolean hashClass(Class<?> klass, Class<?> face) {
if (klass.equals(face)) {
return true;
} else {
if (Object.class.equals(klass)) {
return false;
}
Class<?>[] cls = klass.getInterfaces();
for (int i = 0; i < cls.length; i++) {
if (hashClass(cls[i], face)) {
return true;
}
}
if (!klass.isInterface()) {
if (hashClass(klass.getSuperclass(), face)) {
return true;
}
}
}
return false;
}
private Class<?> getFeildFanClass(Field field,int index) throws ClassNotFoundException {
return getClass(getFeildFan(field, index));
}
/**
* Type 类型转 class
* */
private Class<?> getClass(Type type) throws ClassNotFoundException{
String cStr=type.toString();
if(cStr.indexOf("class ")==0){
return Class.forName(cStr.substring(6, cStr.length()));
}else if(cStr.indexOf("interface ")==0){
return Class.forName(cStr.substring(10, cStr.length()));
}else{
if(cStr.indexOf("<")!=-1){
return Class.forName(cStr.substring(0, cStr.indexOf("<")));
}
return Class.forName(cStr.substring(0, cStr.length()));
}
}
private Type getFeildFan(Field field,int index) {
Type type = field.getGenericType();
if(type instanceof ParameterizedType){
return ((ParameterizedType)type).getActualTypeArguments()[index];
}
return field.getType();
}
}

View File

@ -0,0 +1,100 @@
package com.xjrsoft.module.datalog.vo;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField;
import com.pictc.common.mybatis.JsonTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 数据变更日志实体类
* 用于记录数据库字段修改和实体删除操作
*/
@ApiModel(value = "DataChangeLogDto对象", description = "数据变更日志")
@Data
@Accessors(chain = true)
public class DataChangeLogDto implements Serializable{
/**
* @Fields {todo}(用一句话描述这个变量表示什么)
*/
private static final long serialVersionUID = 1L;
/**
* 日志ID主键
*/
@ApiModelProperty("主键")
private Long id;
/**
* 父表ID,根节点#
*/
@ApiModelProperty("父表ID")
private String pid = "#";
/**
* 实体类名称(全类名)
*/
@ApiModelProperty("实体类名称(全类名)")
private String entityClassName;
/**
* 实体类简称(简单类名)
*/
@ApiModelProperty("实体类简称(简单类名)")
private String entitySimpleName;
/**
* 操作的实体ID主键值
*/
@ApiModelProperty("操作的实体ID主键值")
private Long entityId;
/**
* 字段变更详情
* key: 字段名
* value: 包含旧值和新值的Map
*/
@TableField(typeHandler = JsonTypeHandler.class)
@ApiModelProperty("属性值记录")
private List<FieldChangeDto> fieldChanges;
/**
* 操作类型INSERT-新增UPDATE-修改DELETE-删除
*/
@ApiModelProperty("操作类型INSERT-新增UPDATE-修改DELETE-删除")
private OperationType operationType;
/**
* 操作人ID
*/
@ApiModelProperty("操作人ID")
private String operatorId;
/**
* 操作人姓名
*/
@ApiModelProperty("操作人姓名")
private String operatorName;
/**
* 操作时间
*/
@ApiModelProperty("操作时间")
private LocalDateTime operationTime;
/**
* 操作IP地址
*/
@ApiModelProperty("操作IP地址")
private String operationIp;
}

View File

@ -0,0 +1,39 @@
package com.xjrsoft.module.datalog.vo;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
@ApiModel(value = "FieldChangeDto对象", description = "数据变更字段记录")
@Data
@Accessors(chain = true)
public class FieldChangeDto implements Serializable{
private static final long serialVersionUID = 1L;
@ApiModelProperty("属性名称")
private String name;
@ApiModelProperty("属性")
private String field;
/**
* 旧值
*/
@ApiModelProperty("旧值")
private Object oldValue;
/**
* 新值
*/
@ApiModelProperty("新值")
private Object newValue;
}

View File

@ -0,0 +1,8 @@
package com.xjrsoft.module.datalog.vo;
/**
* 操作类型枚举
*/
public enum OperationType {
INSERT, UPDATE, DELETE
}

View File

@ -0,0 +1,5 @@
#Generated by Maven
#Wed Sep 24 16:43:44 CST 2025
version=2.0.4
groupId=com.geg
artifactId=itc-pcitc-dependencies-api

View File

@ -0,0 +1,13 @@
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\xjrsoft\module\datalog\vo\FieldChangeDto.java
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\xjrsoft\module\datalog\vo\OperationType.java
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\pictc\annotations\datalog\JoinCaseType.java
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\pictc\annotations\datalog\LogField.java
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\pictc\annotations\datalog\JoinValueType.java
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\pictc\annotations\datalog\LogJoin.java
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\pictc\annotations\datalog\JoinType.java
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\pictc\common\mybatis\JsonTypeHandler.java
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\xjrsoft\module\datalog\vo\DataChangeLogDto.java
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\pictc\annotations\datalog\ValueDirectionType.java
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\pictc\annotations\datalog\SourceType.java
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\pictc\annotations\datalog\LogTable.java
F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-dependencies\itc-pcitc-dependencies-api\src\main\java\com\pictc\annotations\datalog\LogJoinColumn.java