1、删除无用demo代码
2、添加主数据模块项目
This commit is contained in:
@ -1,22 +0,0 @@
|
||||
package com.xjrsoft.module.prdManage.client;
|
||||
|
||||
import com.xjrsoft.common.constant.GlobalConstant;
|
||||
import com.xjrsoft.module.prdManage.dto.DemoAppliancePageDto;
|
||||
import com.xjrsoft.module.prdManage.vo.DemoApplianceVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: yjw
|
||||
* @since: 2025/3/4
|
||||
*/
|
||||
@FeignClient(value = "demo-service",
|
||||
path = GlobalConstant.CLIENT_API_PRE + "prdManage/demoAppliance")
|
||||
public interface IDemoApplianceClient {
|
||||
|
||||
@PostMapping("/getListByQuery")
|
||||
List<DemoApplianceVo> getListByQuery(@RequestBody DemoAppliancePageDto dto);
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
package com.xjrsoft.module.prdManage.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 示例-家电管理
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class AddDemoApplianceDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String serialNumber;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String category;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private LocalDateTime purchaseDate;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Integer warrantyPeriod;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Integer powerRating;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String brand;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Double sellingPrice;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
package com.xjrsoft.module.prdManage.dto;
|
||||
|
||||
import com.xjrsoft.common.page.PageInput;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 分页查询入参
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class DemoAppliancePageDto extends PageInput {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String serialNumber;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String category;
|
||||
|
||||
}
|
||||
@ -1,72 +0,0 @@
|
||||
package com.xjrsoft.module.prdManage.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 示例-家电管理
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class UpdateDemoApplianceDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Integer id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String serialNumber;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String category;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private LocalDateTime purchaseDate;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Integer warrantyPeriod;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Integer powerRating;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String brand;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Double sellingPrice;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@ -1,68 +0,0 @@
|
||||
package com.xjrsoft.module.prdManage.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @title: 分页列表出参
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class DemoAppliancePageVo {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String serialNumber;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String category;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private LocalDateTime purchaseDate;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Integer warrantyPeriod;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Integer powerRating;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String brand;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Double sellingPrice;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@ -1,70 +0,0 @@
|
||||
package com.xjrsoft.module.prdManage.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @title: 表单出参
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class DemoApplianceVo {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Integer id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String serialNumber;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String category;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private LocalDateTime purchaseDate;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Integer warrantyPeriod;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Integer powerRating;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String brand;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Double sellingPrice;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String status;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
package com.xjrsoft.module.relationManage.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* @title: demo_客户管理
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-11
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class AddDemoCustomerDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String gender;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String phone;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String email;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String address;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String company;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String position;
|
||||
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package com.xjrsoft.module.relationManage.dto;
|
||||
|
||||
import com.xjrsoft.common.page.PageInput;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 分页查询入参
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-11
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class DemoCustomerPageDto extends PageInput {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String gender;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String phone;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String email;
|
||||
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package com.xjrsoft.module.relationManage.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* @title: demo_客户管理
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-11
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class UpdateDemoCustomerDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Long id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String gender;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String phone;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String email;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String address;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String company;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String position;
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
package com.xjrsoft.module.relationManage.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @title: 分页列表出参
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-11
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class DemoCustomerPageVo {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String gender;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String phone;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String email;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String address;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String company;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String position;
|
||||
|
||||
}
|
||||
@ -1,74 +0,0 @@
|
||||
package com.xjrsoft.module.relationManage.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @title: 表单出参
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-11
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class DemoCustomerVo {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Long id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String gender;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String phone;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String email;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String address;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String company;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String position;
|
||||
|
||||
@ApiModelProperty("")
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Long deptId;
|
||||
|
||||
|
||||
}
|
||||
@ -1,220 +0,0 @@
|
||||
<?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>demo</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>demo-service</artifactId>
|
||||
<name>demo-service</name>
|
||||
<description>demo-service</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-common-service</artifactId>
|
||||
<version>${framework.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>demo-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- springCloud 整合的openFeign -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--引入nacos依赖-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--引入spring-cloud-alibaba-nacos-config依赖-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--引入spring-cloud-alibaba-nacos-config bootstrap依赖-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--引入sentinel依赖-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-xml</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.csp</groupId>
|
||||
<artifactId>sentinel-datasource-nacos</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- mybatis-plus 多表关联 -->
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.cloud.govern</groupId>
|
||||
<artifactId>service-invoke-sdk</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.freemarker</groupId>
|
||||
<artifactId>freemarker</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.unfbx</groupId>
|
||||
<artifactId>chatgpt-java</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>tech.powerjob</groupId>
|
||||
<artifactId>powerjob-worker-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.zhyd.oauth</groupId>
|
||||
<artifactId>JustAuth</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-authz-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.microsoft.ews-java-api</groupId>
|
||||
<artifactId>ews-java-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>tech.powerjob</groupId>
|
||||
<artifactId>powerjob-official-processors</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>tech.powerjob</groupId>
|
||||
<artifactId>powerjob-worker</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.smallbun.screw</groupId>
|
||||
<artifactId>screw-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-okhttp</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</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>
|
||||
@ -1,25 +0,0 @@
|
||||
package com.xjrsoft;
|
||||
|
||||
import com.xjrsoft.common.annotation.UniqueNameGenerator;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
|
||||
/**
|
||||
* @author Zexy
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableAspectJAutoProxy(exposeProxy = true)
|
||||
@ComponentScan(nameGenerator = UniqueNameGenerator.class)
|
||||
@EnableFeignClients
|
||||
@EnableDiscoveryClient
|
||||
public class ITCDemoApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ITCDemoApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
package com.xjrsoft.common.schedule;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Component
|
||||
@ConditionalOnProperty(name = {"schedule.enabled","schedule.sync-xx.enabled"}, havingValue = "true")
|
||||
@Slf4j
|
||||
@EnableScheduling
|
||||
public class DemoSysncTask {
|
||||
@Scheduled(cron = "${schedule.sync-xx.cron:0 0/60 * * * *}") //60分钟跑一次
|
||||
public void sync(){
|
||||
log.info("同步XX数据 => " + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
try{
|
||||
//todo 任务具体实现
|
||||
} catch (Exception e){
|
||||
log.error("同步XX数据失败:" + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
package com.xjrsoft.common.util;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class SpringContextUtil implements ApplicationContextAware {
|
||||
|
||||
private static ApplicationContext context;
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) {
|
||||
SpringContextUtil.context = applicationContext;
|
||||
}
|
||||
|
||||
public static ApplicationContext getApplicationContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public static <T> T getBean(Class<T> beanClass) {
|
||||
return context.getBean(beanClass);
|
||||
}
|
||||
|
||||
public static Object getBean(String beanName) {
|
||||
return context.getBean(beanName);
|
||||
}
|
||||
}
|
||||
@ -1,98 +0,0 @@
|
||||
package com.xjrsoft.module.prdManage.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.xjrsoft.common.model.result.R;
|
||||
import com.xjrsoft.common.page.ConventPage;
|
||||
import com.xjrsoft.common.page.PageOutput;
|
||||
import com.xjrsoft.common.utils.VoToColumnUtil;
|
||||
import com.xjrsoft.module.prdManage.dto.AddDemoApplianceDto;
|
||||
import com.xjrsoft.module.prdManage.dto.DemoAppliancePageDto;
|
||||
import com.xjrsoft.module.prdManage.dto.UpdateDemoApplianceDto;
|
||||
import com.xjrsoft.module.prdManage.entity.DemoAppliance;
|
||||
import com.xjrsoft.module.prdManage.service.IDemoApplianceService;
|
||||
import com.xjrsoft.module.prdManage.vo.DemoAppliancePageVo;
|
||||
import com.xjrsoft.module.prdManage.vo.DemoApplianceVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @title: 示例-家电管理
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/prdManage" + "/demoAppliance")
|
||||
@Api(value = "/prdManage" + "/demoAppliance",tags = "示例-家电管理代码")
|
||||
@AllArgsConstructor
|
||||
public class DemoApplianceController {
|
||||
|
||||
|
||||
private final IDemoApplianceService demoApplianceService;
|
||||
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperation(value="DemoAppliance列表(分页)")
|
||||
@SaCheckPermission("demoAppliance:list")
|
||||
public R page(@Valid DemoAppliancePageDto dto){
|
||||
|
||||
LambdaQueryWrapper<DemoAppliance> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper
|
||||
.like(StrUtil.isNotBlank(dto.getName()),DemoAppliance::getName,dto.getName())
|
||||
.like(StrUtil.isNotBlank(dto.getSerialNumber()),DemoAppliance::getSerialNumber,dto.getSerialNumber())
|
||||
.like(StrUtil.isNotBlank(dto.getCategory()),DemoAppliance::getCategory,dto.getCategory())
|
||||
.orderByDesc(DemoAppliance::getId)
|
||||
.select(DemoAppliance.class,x -> VoToColumnUtil.fieldsToColumns(DemoAppliancePageVo.class).contains(x.getProperty()));
|
||||
IPage<DemoAppliance> page = demoApplianceService.page(ConventPage.getPage(dto), queryWrapper);
|
||||
PageOutput<DemoAppliancePageVo> pageOutput = ConventPage.getPageOutput(page, DemoAppliancePageVo.class);
|
||||
return R.ok(pageOutput);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/info")
|
||||
@ApiOperation(value="根据id查询DemoAppliance信息")
|
||||
@SaCheckPermission("demoAppliance:detail")
|
||||
public R info(@RequestParam Integer id){
|
||||
DemoAppliance demoAppliance = demoApplianceService.getById(id);
|
||||
if (demoAppliance == null) {
|
||||
return R.error("找不到此数据!");
|
||||
}
|
||||
return R.ok(BeanUtil.toBean(demoAppliance, DemoApplianceVo.class));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation(value = "新增DemoAppliance")
|
||||
@SaCheckPermission("demoAppliance:add")
|
||||
public R add(@Valid @RequestBody AddDemoApplianceDto dto){
|
||||
DemoAppliance demoAppliance = BeanUtil.toBean(dto, DemoAppliance.class);
|
||||
boolean isSuccess = demoApplianceService.save(demoAppliance);
|
||||
return R.ok(demoAppliance.getId());
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation(value = "修改DemoAppliance")
|
||||
@SaCheckPermission("demoAppliance:edit")
|
||||
public R update(@Valid @RequestBody UpdateDemoApplianceDto dto){
|
||||
|
||||
DemoAppliance demoAppliance = BeanUtil.toBean(dto, DemoAppliance.class);
|
||||
return R.ok(demoApplianceService.updateById(demoAppliance));
|
||||
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation(value = "删除")
|
||||
@SaCheckPermission("demoAppliance:delete")
|
||||
public R delete(@Valid @RequestBody List<Integer> ids){
|
||||
return R.ok(demoApplianceService.removeBatchByIds(ids));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,79 +0,0 @@
|
||||
package com.xjrsoft.module.prdManage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 示例-家电管理
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("demo_appliance")
|
||||
@ApiModel(value = "示例-家电管理对象", description = "示例-家电管理")
|
||||
public class DemoAppliance implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String serialNumber;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String category;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private LocalDateTime purchaseDate;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Integer warrantyPeriod;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Integer powerRating;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String brand;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Double sellingPrice;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package com.xjrsoft.module.prdManage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xjrsoft.module.prdManage.entity.DemoAppliance;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface DemoApplianceMapper extends BaseMapper<DemoAppliance> {
|
||||
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
package com.xjrsoft.module.prdManage.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xjrsoft.module.prdManage.entity.DemoAppliance;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-12
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
public interface IDemoApplianceService extends IService<DemoAppliance> {
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.xjrsoft.module.prdManage.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xjrsoft.module.prdManage.entity.DemoAppliance;
|
||||
import com.xjrsoft.module.prdManage.mapper.DemoApplianceMapper;
|
||||
import com.xjrsoft.module.prdManage.service.IDemoApplianceService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-12
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class DemoApplianceServiceImpl extends ServiceImpl<DemoApplianceMapper, DemoAppliance> implements IDemoApplianceService {
|
||||
}
|
||||
@ -1,99 +0,0 @@
|
||||
package com.xjrsoft.module.relationManage.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.xjrsoft.common.model.result.R;
|
||||
import com.xjrsoft.common.page.ConventPage;
|
||||
import com.xjrsoft.common.page.PageOutput;
|
||||
import com.xjrsoft.common.utils.VoToColumnUtil;
|
||||
import com.xjrsoft.module.relationManage.dto.AddDemoCustomerDto;
|
||||
import com.xjrsoft.module.relationManage.dto.DemoCustomerPageDto;
|
||||
import com.xjrsoft.module.relationManage.dto.UpdateDemoCustomerDto;
|
||||
import com.xjrsoft.module.relationManage.entity.DemoCustomer;
|
||||
import com.xjrsoft.module.relationManage.service.IDemoCustomerManageService;
|
||||
import com.xjrsoft.module.relationManage.vo.DemoCustomerPageVo;
|
||||
import com.xjrsoft.module.relationManage.vo.DemoCustomerVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @title: demo_客户管理
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-11
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/relationManage" + "/demoCustomerManage")
|
||||
@Api(value = "/relationManage" + "/demoCustomerManage",tags = "demo_客户管理代码")
|
||||
@AllArgsConstructor
|
||||
public class DemoCustomerManageController {
|
||||
|
||||
|
||||
private final IDemoCustomerManageService demoCustomerManageService;
|
||||
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperation(value="DemoCustomer列表(分页)")
|
||||
@SaCheckPermission("demoCustomerManage:list")
|
||||
public R page(@Valid DemoCustomerPageDto dto){
|
||||
|
||||
LambdaQueryWrapper<DemoCustomer> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper
|
||||
.like(StrUtil.isNotBlank(dto.getName()),DemoCustomer::getName,dto.getName())
|
||||
.like(StrUtil.isNotBlank(dto.getGender()),DemoCustomer::getGender,dto.getGender())
|
||||
.like(StrUtil.isNotBlank(dto.getPhone()),DemoCustomer::getPhone,dto.getPhone())
|
||||
.like(StrUtil.isNotBlank(dto.getEmail()),DemoCustomer::getEmail,dto.getEmail())
|
||||
.orderByDesc(DemoCustomer::getId)
|
||||
.select(DemoCustomer.class,x -> VoToColumnUtil.fieldsToColumns(DemoCustomerPageVo.class).contains(x.getProperty()));
|
||||
IPage<DemoCustomer> page = demoCustomerManageService.page(ConventPage.getPage(dto), queryWrapper);
|
||||
PageOutput<DemoCustomerPageVo> pageOutput = ConventPage.getPageOutput(page, DemoCustomerPageVo.class);
|
||||
return R.ok(pageOutput);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/info")
|
||||
@ApiOperation(value="根据id查询DemoCustomer信息")
|
||||
@SaCheckPermission("demoCustomerManage:detail")
|
||||
public R info(@RequestParam Long id){
|
||||
DemoCustomer demoCustomer = demoCustomerManageService.getById(id);
|
||||
if (demoCustomer == null) {
|
||||
return R.error("找不到此数据!");
|
||||
}
|
||||
return R.ok(BeanUtil.toBean(demoCustomer, DemoCustomerVo.class));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation(value = "新增DemoCustomer")
|
||||
@SaCheckPermission("demoCustomerManage:add")
|
||||
public R add(@Valid @RequestBody AddDemoCustomerDto dto){
|
||||
DemoCustomer demoCustomer = BeanUtil.toBean(dto, DemoCustomer.class);
|
||||
boolean isSuccess = demoCustomerManageService.save(demoCustomer);
|
||||
return R.ok(demoCustomer.getId());
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation(value = "修改DemoCustomer")
|
||||
@SaCheckPermission("demoCustomerManage:edit")
|
||||
public R update(@Valid @RequestBody UpdateDemoCustomerDto dto){
|
||||
|
||||
DemoCustomer demoCustomer = BeanUtil.toBean(dto, DemoCustomer.class);
|
||||
return R.ok(demoCustomerManageService.updateById(demoCustomer));
|
||||
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation(value = "删除")
|
||||
@SaCheckPermission("demoCustomerManage:delete")
|
||||
public R delete(@Valid @RequestBody List<Long> ids){
|
||||
return R.ok(demoCustomerManageService.removeBatchByIds(ids));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,90 +0,0 @@
|
||||
package com.xjrsoft.module.relationManage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* @title: demo_客户管理
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-11
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("demo_customer")
|
||||
@ApiModel(value = "demo_客户管理对象", description = "demo_客户管理")
|
||||
public class DemoCustomer implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String gender;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String phone;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String email;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String address;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String company;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private String position;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long deptId;
|
||||
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package com.xjrsoft.module.relationManage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xjrsoft.module.relationManage.entity.DemoCustomer;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-11
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface DemoCustomerMapper extends BaseMapper<DemoCustomer> {
|
||||
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
package com.xjrsoft.module.relationManage.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.xjrsoft.module.relationManage.entity.DemoCustomer;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-11
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
public interface IDemoCustomerManageService extends IService<DemoCustomer> {
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.xjrsoft.module.relationManage.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xjrsoft.module.relationManage.entity.DemoCustomer;
|
||||
import com.xjrsoft.module.relationManage.mapper.DemoCustomerMapper;
|
||||
import com.xjrsoft.module.relationManage.service.IDemoCustomerManageService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
* @Date: 2025-03-11
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class DemoCustomerManageServiceImpl extends ServiceImpl<DemoCustomerMapper, DemoCustomer> implements IDemoCustomerManageService {
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
██╗ ██╗ ██╗██████╗ ███████╗ ██████╗ ███████╗████████╗
|
||||
╚██╗██╔╝ ██║██╔══██╗██╔════╝██╔═══██╗██╔════╝╚══██╔══╝
|
||||
╚███╔╝ ██║██████╔╝███████╗██║ ██║█████╗ ██║
|
||||
██╔██╗ ██ ██║██╔══██╗╚════██║██║ ██║██╔══╝ ██║
|
||||
██╔╝ ██╗╚█████╔╝██║ ██║███████║╚██████╔╝██║ ██║
|
||||
╚═╝ ╚═╝ ╚════╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝
|
||||
@ -1,237 +0,0 @@
|
||||
<?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>ms-demo</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>facade-service</artifactId>
|
||||
<name>facade-service</name>
|
||||
<description>facade-service</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-common-service</artifactId>
|
||||
<version>${framework.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-facade-api</artifactId>
|
||||
<version>${framework.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- springCloud 整合的openFeign -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--引入nacos依赖-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--引入spring-cloud-alibaba-nacos-config依赖-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--引入spring-cloud-alibaba-nacos-config bootstrap依赖-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--引入sentinel依赖-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-xml</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.csp</groupId>
|
||||
<artifactId>sentinel-datasource-nacos</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- mybatis-plus 多表关联 -->
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.cloud.govern</groupId>
|
||||
<artifactId>service-invoke-sdk</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.freemarker</groupId>
|
||||
<artifactId>freemarker</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.unfbx</groupId>
|
||||
<artifactId>chatgpt-java</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>tech.powerjob</groupId>
|
||||
<artifactId>powerjob-worker-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.zhyd.oauth</groupId>
|
||||
<artifactId>JustAuth</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-authz-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.microsoft.ews-java-api</groupId>
|
||||
<artifactId>ews-java-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>tech.powerjob</groupId>
|
||||
<artifactId>powerjob-official-processors</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>tech.powerjob</groupId>
|
||||
<artifactId>powerjob-worker</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.smallbun.screw</groupId>
|
||||
<artifactId>screw-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.github.openfeign</groupId>
|
||||
<artifactId>feign-okhttp</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.7.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!--<classifier>classes</classifier>-->
|
||||
<attach>false</attach>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<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>
|
||||
@ -1,42 +0,0 @@
|
||||
package com.xjrsoft.module.magicapi.client;
|
||||
|
||||
import com.xjrsoft.common.constant.GlobalConstant;
|
||||
import com.xjrsoft.module.magicapi.dto.ExecuteWorkflowApiDto;
|
||||
import com.xjrsoft.module.magicapi.vo.MagicApiInfoVo;
|
||||
import com.xjrsoft.module.magicapi.service.IMagicApiService;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @Author: tzx
|
||||
* @Date: 2023/10/10 17:43
|
||||
*/
|
||||
@Api(hidden = true)
|
||||
@RestController
|
||||
@RequestMapping(GlobalConstant.CLIENT_API_PRE + GlobalConstant.MAGICAPI_MODULE_PREFIX + "/magic-api")
|
||||
@AllArgsConstructor
|
||||
public class MagicApiClientImpl implements IMagicApiClient {
|
||||
|
||||
private IMagicApiService magicApiService;
|
||||
|
||||
|
||||
@Override
|
||||
@GetMapping("/executeApi")
|
||||
public Object executeApi(@RequestParam("id") String id) {
|
||||
return magicApiService.executeApi(id);
|
||||
}
|
||||
|
||||
@PostMapping("/executeWorkflowApi")
|
||||
@Override
|
||||
public Object executeWorkflowApi(@RequestBody ExecuteWorkflowApiDto dto) {
|
||||
return magicApiService.executeWorkflowApi(dto.getApiConfig(), dto.getProcessParam(), dto.getVarMap(), dto.getProcessInstId(), dto.getExecutionId());
|
||||
}
|
||||
|
||||
@GetMapping("/info")
|
||||
@Override
|
||||
public MagicApiInfoVo info(@RequestParam("id") String id) {
|
||||
return magicApiService.info(id);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,64 +0,0 @@
|
||||
package com.xjrsoft.module.magicapi.controller;
|
||||
|
||||
|
||||
import com.xjrsoft.common.annotation.XjrLog;
|
||||
import com.xjrsoft.common.constant.GlobalConstant;
|
||||
import com.xjrsoft.common.model.result.R;
|
||||
import com.xjrsoft.module.magicapi.vo.MagicApiTreeVo;
|
||||
import com.xjrsoft.module.magicapi.service.IMagicApiService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* magic-api模块接口
|
||||
* </p>
|
||||
*
|
||||
* @author tzx
|
||||
* @since 2022-10-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(GlobalConstant.MAGICAPI_MODULE_PREFIX)
|
||||
@Api(value = GlobalConstant.MAGICAPI_MODULE_PREFIX, tags = "magic-api模块接口")
|
||||
@AllArgsConstructor
|
||||
public class MagicApiController {
|
||||
|
||||
private final IMagicApiService magicApiService;
|
||||
|
||||
@GetMapping(value = "/tree")
|
||||
@ApiOperation("查询所有分组以及api 树结构")
|
||||
@XjrLog(value = "查询所有分组以及api 树结构")
|
||||
public R tree(@RequestParam(required = false) String keyword ) {
|
||||
List<MagicApiTreeVo> tree = magicApiService.tree(keyword);
|
||||
return R.ok(tree);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/group/tree")
|
||||
@ApiOperation("查询所有树结构分组")
|
||||
@XjrLog(value = "查询所有树结构分组")
|
||||
public R groupTree(){
|
||||
return R.ok(magicApiService.groupTree());
|
||||
}
|
||||
|
||||
@GetMapping(value = "/info")
|
||||
@ApiOperation("查询api详情")
|
||||
@XjrLog(value = "查询api详情")
|
||||
public R info(@RequestParam String id){
|
||||
return R.ok(magicApiService.info(id));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/list")
|
||||
@ApiOperation("根据分组id 查询所有api")
|
||||
@XjrLog(value = "根据分组id 查询所有api")
|
||||
public R list(@RequestParam String groupId){
|
||||
return R.ok(magicApiService.list(groupId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
package com.xjrsoft.module.magicapi.service;
|
||||
|
||||
import com.xjrsoft.module.magicapi.vo.MagicApiGroupTreeVo;
|
||||
import com.xjrsoft.module.magicapi.vo.MagicApiInfoVo;
|
||||
import com.xjrsoft.module.magicapi.vo.MagicApiTreeVo;
|
||||
import com.xjrsoft.module.workflow.model.ApiConfig;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IMagicApiService {
|
||||
|
||||
/**
|
||||
* 分组以及api 树结构
|
||||
* @return
|
||||
*/
|
||||
List<MagicApiTreeVo> tree(String keyword);
|
||||
|
||||
/**
|
||||
* 分组树
|
||||
* @return
|
||||
*/
|
||||
List<MagicApiGroupTreeVo> groupTree();
|
||||
|
||||
/**
|
||||
* 根据 id 获取 接口信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
MagicApiInfoVo info(String id);
|
||||
|
||||
/**
|
||||
* 根据分组查询所有接口
|
||||
* @param groupId
|
||||
* @return
|
||||
*/
|
||||
List<MagicApiInfoVo> list(String groupId);
|
||||
|
||||
/**
|
||||
* 执行API
|
||||
* @param id 接口id
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T executeApi(String id);
|
||||
|
||||
/**
|
||||
* 执行工作流api
|
||||
* @param apiConfig
|
||||
* @param processParam
|
||||
* @param varMap
|
||||
* @return
|
||||
*/
|
||||
Object executeWorkflowApi(ApiConfig apiConfig, Map<String, Object> processParam, Map<String, Object> varMap,String processInstId,String executionId);
|
||||
}
|
||||
@ -1,195 +0,0 @@
|
||||
package com.xjrsoft.module.magicapi.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.xjrsoft.common.utils.TreeUtil;
|
||||
import com.xjrsoft.module.magicapi.vo.MagicApiGroupTreeVo;
|
||||
import com.xjrsoft.module.magicapi.vo.MagicApiInfoVo;
|
||||
import com.xjrsoft.module.magicapi.vo.MagicApiTreeVo;
|
||||
import com.xjrsoft.module.workflow.model.ApiConfig;
|
||||
import com.xjrsoft.module.workflow.model.ApiRequestParamsConfig;
|
||||
import com.xjrsoft.module.magicapi.service.IMagicApiService;
|
||||
import com.xjrsoft.module.magicapi.utils.MagicApiUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.ssssssss.magicapi.core.model.*;
|
||||
import org.ssssssss.magicapi.core.service.MagicAPIService;
|
||||
import org.ssssssss.magicapi.core.service.MagicResourceService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* magic-api服务
|
||||
*
|
||||
* @author apple
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class MagicApiServiceImpl implements IMagicApiService {
|
||||
|
||||
private final MagicResourceService magicResourceService;
|
||||
|
||||
private final MagicAPIService magicAPIService;
|
||||
|
||||
@Override
|
||||
public List<MagicApiTreeVo> tree(String keyword) {
|
||||
TreeNode<Group> tree = magicResourceService.tree("api");
|
||||
|
||||
List<TreeNode<Group>> children = tree.getChildren();
|
||||
|
||||
return TreeUtil.build(buildTreeData(children, keyword));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MagicApiGroupTreeVo> groupTree() {
|
||||
TreeNode<Group> tree = magicResourceService.tree("api");
|
||||
|
||||
List<TreeNode<Group>> children = tree.getChildren();
|
||||
List<MagicApiGroupTreeVo> treeVoList = new ArrayList<>();
|
||||
buildGroupTreeData(treeVoList, children);
|
||||
return TreeUtil.build(treeVoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MagicApiInfoVo info(String id) {
|
||||
MagicEntity entity = magicResourceService.file(id);
|
||||
BaseDefinition requestBodyDefinition = ((ApiInfo) entity).getRequestBodyDefinition();
|
||||
MagicApiInfoVo magicApiInfoVo = BeanUtil.toBean(entity, MagicApiInfoVo.class);
|
||||
String groupId = entity.getGroupId();
|
||||
if (StringUtils.isNotEmpty(groupId)) {
|
||||
String groupPath = magicResourceService.getGroupPath(groupId);
|
||||
magicApiInfoVo.setPath(groupPath + magicApiInfoVo.getPath());
|
||||
}
|
||||
magicApiInfoVo.setRequestBodyDefinition(requestBodyDefinition);
|
||||
return magicApiInfoVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MagicApiInfoVo> list(String groupId) {
|
||||
String groupPath = magicResourceService.getGroupPath(groupId);
|
||||
|
||||
List<MagicEntity> magicEntities = magicResourceService.listFiles(groupId);
|
||||
|
||||
List<MagicApiInfoVo> magicApiInfoVos = BeanUtil.copyToList(magicEntities, MagicApiInfoVo.class);
|
||||
for (MagicApiInfoVo magicApiInfoVo : magicApiInfoVos) {
|
||||
magicApiInfoVo.setPath(groupPath + magicApiInfoVo.getPath());
|
||||
}
|
||||
|
||||
return magicApiInfoVos;
|
||||
}
|
||||
|
||||
public <T> T executeApi(String id) {
|
||||
MagicApiInfoVo info = info(id);
|
||||
return magicAPIService.execute(info.getMethod(), info.getPath(), new HashMap<>());
|
||||
}
|
||||
|
||||
public Object executeWorkflowApi(ApiConfig apiConfig, Map<String, Object> processParam, Map<String, Object> varMap,String processInstId,String executionId){
|
||||
MagicApiInfoVo info = info(apiConfig.getId());
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
for(List<ApiRequestParamsConfig>requestParamsConfigs:new List[]{
|
||||
apiConfig.getRequestParamsConfigs(),
|
||||
apiConfig.getRequestHeaderConfigs(),
|
||||
apiConfig.getRequestBodyConfigs()
|
||||
}){
|
||||
for (ApiRequestParamsConfig requestParamsConfig : requestParamsConfigs) {
|
||||
MagicApiUtil.initApiParams(processParam,varMap,params,requestParamsConfig);
|
||||
}
|
||||
}
|
||||
//补充流程参数
|
||||
params.put("processInstId",processInstId);
|
||||
params.put("executionId",executionId);
|
||||
|
||||
Object result = magicAPIService.execute(info.getMethod(), info.getPath(), params);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分组以及api 树结构
|
||||
*
|
||||
* @param treeNodes
|
||||
* @return
|
||||
*/
|
||||
private List<MagicApiTreeVo> buildTreeData(List<TreeNode<Group>> treeNodes, String keyword) {
|
||||
|
||||
List<MagicApiTreeVo> treeVoList = new ArrayList<>();
|
||||
for (TreeNode<Group> treeNode : treeNodes) {
|
||||
Group node = treeNode.getNode();
|
||||
|
||||
List<MagicEntity> nodeEntity = magicResourceService.listFiles(node.getId());
|
||||
|
||||
|
||||
if(StringUtils.isNotBlank(keyword) && !node.getName().contains(keyword) && nodeEntity.stream().noneMatch(x -> x.getName().contains(keyword) || ((ApiInfo)x).getPath().contains(keyword))){
|
||||
continue;
|
||||
}
|
||||
|
||||
MagicApiTreeVo groupVo = new MagicApiTreeVo();
|
||||
groupVo.setId(node.getId());
|
||||
groupVo.setParentId(node.getParentId());
|
||||
groupVo.setType("group");
|
||||
groupVo.setName(node.getName());
|
||||
|
||||
treeVoList.add(groupVo);
|
||||
|
||||
|
||||
for (MagicEntity magicEntity : nodeEntity) {
|
||||
MagicApiTreeVo vo = new MagicApiTreeVo();
|
||||
|
||||
ApiInfo apiInfo = (ApiInfo) magicEntity;
|
||||
if(StringUtils.isNotBlank(keyword) && !magicEntity.getName().contains(keyword) && !apiInfo.getPath().contains(keyword)){
|
||||
continue;
|
||||
}
|
||||
|
||||
vo.setId(magicEntity.getId());
|
||||
vo.setType("api");
|
||||
vo.setParentId(magicEntity.getGroupId());
|
||||
vo.setName(magicEntity.getName());
|
||||
String groupPath = StringUtils.isEmpty(node.getPath()) ? StringPool.EMPTY : node.getPath();
|
||||
|
||||
vo.setPath(groupPath + apiInfo.getPath());
|
||||
vo.setMethod(apiInfo.getMethod());
|
||||
|
||||
treeVoList.add(vo);
|
||||
}
|
||||
|
||||
|
||||
if (treeNode.getChildren().size() > 0) {
|
||||
treeVoList.addAll(buildTreeData(treeNode.getChildren(), keyword));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return treeVoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建 分组树结构
|
||||
*
|
||||
* @param treeNodes
|
||||
* @return
|
||||
*/
|
||||
private void buildGroupTreeData(List<MagicApiGroupTreeVo> treeVoList, List<TreeNode<Group>> treeNodes) {
|
||||
|
||||
for (TreeNode<Group> treeNode : treeNodes) {
|
||||
Group node = treeNode.getNode();
|
||||
|
||||
MagicApiGroupTreeVo groupVo = new MagicApiGroupTreeVo();
|
||||
|
||||
groupVo.setId(node.getId());
|
||||
groupVo.setParentId(node.getParentId());
|
||||
groupVo.setName(node.getName());
|
||||
|
||||
treeVoList.add(groupVo);
|
||||
List<TreeNode<Group>> children = treeNode.getChildren();
|
||||
if (CollectionUtils.isNotEmpty(children)) {
|
||||
buildGroupTreeData(treeVoList, children);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
package com.xjrsoft.module.magicapi.utils;
|
||||
|
||||
import cn.dev33.satoken.session.SaSession;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||
import com.xjrsoft.common.constant.GlobalConstant;
|
||||
import com.xjrsoft.common.utils.RedisUtil;
|
||||
import com.xjrsoft.module.organization.dto.DepartmentDto;
|
||||
import com.xjrsoft.module.organization.dto.UserDeptRelationDto;
|
||||
import com.xjrsoft.module.organization.dto.UserDto;
|
||||
import com.xjrsoft.module.workflow.constant.WorkflowConstant;
|
||||
import com.xjrsoft.module.workflow.model.ApiRequestParamsConfig;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author: yjw
|
||||
* @since: 2025/3/17
|
||||
*/
|
||||
public class MagicApiUtil {
|
||||
|
||||
public static void initApiParams(Map<String, Object> processParam, Map<String, Object> varMap, Map<String, Object> params, ApiRequestParamsConfig requestParamsConfig) {
|
||||
if (Objects.equals(requestParamsConfig.getAssignmentType(), "value")) { //值
|
||||
params.put(requestParamsConfig.getName(), requestParamsConfig.getValue());
|
||||
} else if (Objects.equals(requestParamsConfig.getAssignmentType(), "processParameter")) { //流程参数
|
||||
params.put(requestParamsConfig.getName(), processParam.get(requestParamsConfig.getConfig()));
|
||||
} else if (Objects.equals(requestParamsConfig.getAssignmentType(), "originator")) {//发起人信息
|
||||
dealApiParam(requestParamsConfig,params,varMap);
|
||||
} else {//表单数据
|
||||
//使用3下划线切割
|
||||
String[] split = requestParamsConfig.getConfig().split(StringPool.UNDERSCORE + StringPool.UNDERSCORE + StringPool.UNDERSCORE);
|
||||
String formKey = split[1];
|
||||
Map<String, Object> formData = MapUtil.get(varMap, formKey, new TypeReference<Map<String, Object>>() {
|
||||
});
|
||||
Object fieldValue = MapUtil.get(formData, split[2], Object.class);
|
||||
params.put(requestParamsConfig.getName(), fieldValue);
|
||||
}
|
||||
}
|
||||
|
||||
private static void dealApiParam(ApiRequestParamsConfig requestParamsConfig, Map<String, Object> params, Map<String, Object> varMap){
|
||||
Long startUserId;
|
||||
if (CollectionUtils.isEmpty(varMap)) {//为空就是发起时的数据
|
||||
//如果是拿发起人的数据,作为流程参数,发起和重新发起赋值,使用当前登录人的信息,如果是其它节点,使用流程的发起人数据信息
|
||||
SaSession tokenSession = StpUtil.getTokenSession();
|
||||
UserDto user = tokenSession.get(GlobalConstant.LOGIN_USER_INFO_KEY, new UserDto());
|
||||
startUserId = user.getId();
|
||||
}else {
|
||||
startUserId = MapUtil.get(varMap, WorkflowConstant.PROCESS_START_USER_ID_KEY, Long.class);
|
||||
}
|
||||
//如果是设置的发起人
|
||||
if (requestParamsConfig.getConfig().contains("initiator_id")) {
|
||||
params.put(requestParamsConfig.getName(), startUserId);
|
||||
}
|
||||
//组织架构名称
|
||||
if (requestParamsConfig.getConfig().contains("initiator_dept_name")) {
|
||||
RedisUtil redisUtil = SpringUtil.getBean(RedisUtil.class);
|
||||
List<UserDeptRelationDto> userDeptRelations = redisUtil.get(GlobalConstant.USER_DEPT_RELATION_CACHE_KEY, new TypeReference<List<UserDeptRelationDto>>() {
|
||||
});
|
||||
List<DepartmentDto> departmentList = redisUtil.get(GlobalConstant.DEP_CACHE_KEY, new TypeReference<List<DepartmentDto>>() {
|
||||
});
|
||||
List<UserDeptRelationDto> startUserDeptRelation = userDeptRelations.stream().filter(x -> x.getUserId().equals(startUserId)).collect(Collectors.toList());
|
||||
|
||||
List<Long> allDeptIds = startUserDeptRelation.stream().map(UserDeptRelationDto::getDeptId).collect(Collectors.toList());
|
||||
|
||||
List<DepartmentDto> allDept = departmentList.stream().filter(x -> allDeptIds.contains(x.getId())).collect(Collectors.toList());
|
||||
|
||||
params.put(requestParamsConfig.getName(), allDept.stream().map(DepartmentDto::getName).collect(Collectors.joining(",")));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,87 +0,0 @@
|
||||
package com.xjrsoft.module.workflow.client;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.xjrsoft.common.constant.GlobalConstant;
|
||||
import com.xjrsoft.module.workflow.dto.WorkflowBusinessInvokeDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: tzx
|
||||
* @Date: 2023/10/10 17:43
|
||||
*/
|
||||
@Api(hidden = true)
|
||||
@RestController
|
||||
@RequestMapping(GlobalConstant.CLIENT_API_PRE + GlobalConstant.MAGICAPI_MODULE_PREFIX + "/invoke")
|
||||
@AllArgsConstructor
|
||||
public class WorkflowBusinessClientImpl implements IWorkflowBusinessClient {
|
||||
|
||||
/**
|
||||
* 统一调用方法
|
||||
*
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@PostMapping("/invoke")
|
||||
@Override
|
||||
public Boolean invoke(@RequestBody @Valid WorkflowBusinessInvokeDto dto) {
|
||||
String classNameAndMethodName = dto.getClassNameAndMethodName();
|
||||
try {
|
||||
// 分割类名和方法名
|
||||
String[] parts = classNameAndMethodName.split("\\.");
|
||||
if (parts.length < 2) {
|
||||
throw new IllegalArgumentException("Invalid format: className.methodName");
|
||||
}
|
||||
String className = String.join(".", java.util.Arrays.copyOf(parts, parts.length - 1));
|
||||
String methodName = parts[parts.length - 1];
|
||||
|
||||
// 动态加载类
|
||||
Class<?> clazz = Class.forName(className);
|
||||
|
||||
// 获取方法的参数类型
|
||||
List<Object> args = dto.getArgs();
|
||||
Class<?>[] parameterTypes = new Class[args.size()];
|
||||
for (int i = 0; i < dto.getArgs().size(); i++) {
|
||||
if (dto.getArgs().get(i) instanceof HashMap) {
|
||||
parameterTypes[i] = Map.class;
|
||||
} else {
|
||||
parameterTypes[i] = args.get(i).getClass();
|
||||
}
|
||||
}
|
||||
|
||||
// 获取方法对象
|
||||
Method method = clazz.getDeclaredMethod(methodName, parameterTypes);
|
||||
method.setAccessible(true); // 确保可以访问私有方法
|
||||
|
||||
// 判断是否为静态方法
|
||||
boolean isStatic = java.lang.reflect.Modifier.isStatic(method.getModifiers());
|
||||
|
||||
// 调用方法
|
||||
if (isStatic) {
|
||||
return (Boolean) method.invoke(null, args.toArray()); // 静态方法,传入 null
|
||||
} else {
|
||||
Object bean = SpringUtil.getBean(className);
|
||||
if (bean != null) {
|
||||
Method methodBean = bean.getClass().getMethod(methodName, parameterTypes);
|
||||
return (Boolean) methodBean.invoke(bean, args.toArray());
|
||||
} else {
|
||||
Object instance = clazz.getDeclaredConstructor().newInstance(); // 创建实例
|
||||
return (Boolean) method.invoke(instance, args.toArray()); // 实例方法,传入实例
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Failed to invoke method: " + classNameAndMethodName, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
██╗ ██╗ ██╗██████╗ ███████╗ ██████╗ ███████╗████████╗
|
||||
╚██╗██╔╝ ██║██╔══██╗██╔════╝██╔═══██╗██╔════╝╚══██╔══╝
|
||||
╚███╔╝ ██║██████╔╝███████╗██║ ██║█████╗ ██║
|
||||
██╔██╗ ██ ██║██╔══██╗╚════██║██║ ██║██╔══╝ ██║
|
||||
██╔╝ ██╗╚█████╔╝██║ ██║███████║╚██████╔╝██║ ██║
|
||||
╚═╝ ╚═╝ ╚════╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,108 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
|
||||
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="./logs" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}][fcd2-ma][%-5p][%t][%c.%M:%L] %msg%xEx%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 用户访问日志输出 -->
|
||||
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-user.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 按天回滚 daily -->
|
||||
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
|
||||
<!--系统用户操作日志-->
|
||||
<logger name="sys-user" level="info">
|
||||
<appender-ref ref="sys-user"/>
|
||||
</logger>
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<!--<logger name="com.xjrsoft" level="info" />-->
|
||||
<!-- Spring日志级别控制 -->
|
||||
<!--<logger name="org.springframework" level="info" />
|
||||
<logger name="org.springframework.web" level="INFO"/>
|
||||
<logger name="org.springboot.sample" level="TRACE" />-->
|
||||
|
||||
<!-- 开发、测试环境 -->
|
||||
<springProfile name="dev,test">
|
||||
<logger name="org.springframework.web" level="INFO"/>
|
||||
<logger name="org.springboot.sample" level="INFO" />
|
||||
<logger name="com.xjrsoft" level="DEBUG" />
|
||||
</springProfile>
|
||||
|
||||
<!-- 生产环境 -->
|
||||
<springProfile name="prod">
|
||||
<logger name="org.springframework.web" level="ERROR"/>
|
||||
<logger name="org.springboot.sample" level="ERROR" />
|
||||
<logger name="com.xjrsoft" level="ERROR" />
|
||||
</springProfile>
|
||||
|
||||
</configuration>
|
||||
@ -1,21 +0,0 @@
|
||||
var MAGIC_EDITOR_CONFIG = {
|
||||
title: 'Admin Web IDE',
|
||||
header: {
|
||||
skin: true, // 屏蔽皮肤按钮
|
||||
document: false, // 屏蔽文档按钮
|
||||
repo: false, // 屏蔽gitee和github
|
||||
qqGroup: false // 屏蔽加入QQ群
|
||||
},
|
||||
// 其它配置参考本页中其它配置项
|
||||
request: {
|
||||
beforeSend: function (config) {
|
||||
// console.log('请求设置', window.location.href);
|
||||
config.headers.Authorization = "Bearer " + window.location.href.split('Authorization=')[1];
|
||||
return config;
|
||||
},
|
||||
onError: function (err) {
|
||||
// console.log('请求出错');
|
||||
return Promise.reject(err)
|
||||
}
|
||||
},
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
# spy.properties
|
||||
driverlist=com.kingbase8.Driver
|
||||
appender=com.p6spy.engine.spy.appender.Slf4JLogger
|
||||
logMessageFormat=com.xjrsoft.common.handler.P6spySqlLogHandler
|
||||
@ -34,6 +34,36 @@
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-system-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-facade-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-common-service</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-workflow-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-user-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>app</finalName>
|
||||
|
||||
@ -1,23 +1,12 @@
|
||||
package com.xjrsoft.module.dev.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.pictc.annotations.datalog.LogField;
|
||||
import com.pictc.annotations.datalog.LogTable;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import com.pictc.annotations.datalog.LogTable;
|
||||
import com.pictc.annotations.datalog.LogField;
|
||||
import com.pictc.annotations.datalog.LogJoin;
|
||||
import com.pictc.annotations.datalog.LogJoinColumn;
|
||||
import com.pictc.annotations.datalog.JoinCaseType;
|
||||
import com.pictc.annotations.datalog.JoinType;
|
||||
import com.pictc.annotations.datalog.ValueDirectionType;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
package com.xjrsoft.module.dev.rules;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.pictc.constant.ContractLiteflowRule;
|
||||
import com.xjrsoft.module.liteflow.client.ILiteFlowChainClient;
|
||||
import com.xjrsoft.module.liteflow.dto.LiteflowChainDto;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
|
||||
import shade.powerjob.com.google.common.collect.Maps;
|
||||
|
||||
@Component
|
||||
public class RuleDemo {
|
||||
|
||||
@Autowired
|
||||
private FlowExecutor flowExecutor;
|
||||
|
||||
@Autowired
|
||||
private ILiteFlowChainClient liteflow;
|
||||
|
||||
/**
|
||||
* @Description: 执行规则
|
||||
* @return void 返回类型
|
||||
*/
|
||||
public void testConfig(){
|
||||
Map<String,Object> params = Maps.newHashMap();
|
||||
LiteflowChainDto dto = liteflow.getByName(ContractLiteflowRule.RULE_TEST);
|
||||
LiteflowResponse liteflowResponse = flowExecutor.execute2Resp(dto.getChainName(),params);
|
||||
System.out.println(liteflowResponse.isSuccess());
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.xjrsoft.module.dev.rules;
|
||||
|
||||
import com.pictc.constant.ContractLiteflowRule;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
|
||||
@LiteflowComponent(ContractLiteflowRule.RULE_TEST_NODEA)
|
||||
public class TestNodeA extends NodeComponent {
|
||||
|
||||
@Override
|
||||
public void process() throws Exception {
|
||||
//TODO 节点A 业务
|
||||
System.out.println("执行节点A");
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.xjrsoft.module.dev.rules;
|
||||
|
||||
import com.pictc.constant.ContractLiteflowRule;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
|
||||
@LiteflowComponent(ContractLiteflowRule.RULE_TEST_NODEB)
|
||||
public class TestNodeB extends NodeComponent {
|
||||
|
||||
@Override
|
||||
public void process() throws Exception {
|
||||
//TODO 节点B 业务
|
||||
System.out.println("执行节点B");
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,11 +1,14 @@
|
||||
package com.xjrsoft.module.dev.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import com.github.yulichang.extension.mapping.base.MPJDeepService;
|
||||
import com.github.yulichang.extension.mapping.base.MPJRelationService;
|
||||
import com.xjrsoft.module.dev.entity.Testfrom3;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -16,4 +19,6 @@ import java.util.List;
|
||||
*/
|
||||
|
||||
public interface ITestfrom3Service extends IService<Testfrom3> {
|
||||
|
||||
void addTestfrom3(Testfrom3 data);
|
||||
}
|
||||
|
||||
@ -2,6 +2,11 @@ package com.xjrsoft.module.dev.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.pictc.enums.BusinessCode;
|
||||
import com.pictc.enums.ExceptionCommonCode;
|
||||
import com.pictc.utils.StringUtils;
|
||||
import com.xjrsoft.common.enums.ResponseCode;
|
||||
import com.xjrsoft.common.exception.BusinessException;
|
||||
import com.xjrsoft.module.dev.entity.Testfrom3;
|
||||
import com.xjrsoft.module.dev.mapper.Testfrom3Mapper;
|
||||
import com.xjrsoft.module.dev.service.ITestfrom3Service;
|
||||
@ -11,6 +16,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
|
||||
/**
|
||||
@ -22,4 +29,27 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class Testfrom3ServiceImpl extends ServiceImpl<Testfrom3Mapper, Testfrom3> implements ITestfrom3Service {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void addTestfrom3(Testfrom3 data) {
|
||||
if (!StringUtils.isEmpty(data.getDanXingWenBen5097())) {
|
||||
throw new BusinessException(ResponseCode.PARAM_MISS);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(data.getDanXingWenBen5097())){
|
||||
Long nameCount = findNameCount(data.getDanXingWenBen5097());
|
||||
if(nameCount!=null && nameCount.intValue() > 0) {
|
||||
throw new BusinessException(BusinessCode.ofArgs(ExceptionCommonCode.DATA_FIELD_DUPLICATION,"规则名称"));
|
||||
}
|
||||
}
|
||||
baseMapper.insert(data);
|
||||
}
|
||||
|
||||
private Long findNameCount(String name) {
|
||||
LambdaQueryWrapper<Testfrom3> queryWrapper = Wrappers.lambdaQuery(Testfrom3.class);
|
||||
queryWrapper.eq(Testfrom3::getDanXingWenBen5097,name);
|
||||
return baseMapper.selectCount(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.xjrsoft.module.prdManage.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.yulichang.autoconfigure.conditional.JoinSqlInjectorCondition;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
import com.pictc.annotations.datalog.JoinCaseType;
|
||||
import com.pictc.annotations.datalog.JoinType;
|
||||
import com.pictc.annotations.datalog.LogJoin;
|
||||
@ -38,10 +38,19 @@ public class Testfrom2 extends BaseMasterEntity {
|
||||
@ApiModelProperty("单行文本")
|
||||
private String danXingWenBen9043;
|
||||
|
||||
@LogJoin(name = "",
|
||||
/**
|
||||
* 单行文本
|
||||
*/
|
||||
@ApiModelProperty("家电")
|
||||
private String applianceId;
|
||||
|
||||
@LogJoin(name = "家电管理",
|
||||
columns = {
|
||||
@LogJoinColumn(field = "",relatedField = "", valueDirection = ValueDirectionType.RIGHT)
|
||||
}, caseType = JoinCaseType.FULL, target = DemoAppliance.class, type = JoinType.MANY)
|
||||
@LogJoinColumn(field = "applianceId",relatedField = "id", valueDirection = ValueDirectionType.LEFT)
|
||||
}, caseType = JoinCaseType.NONE, target = DemoAppliance.class, type = JoinType.ONE)
|
||||
private DemoAppliance appliance;
|
||||
|
||||
@Version
|
||||
private Integer dataVersion; //类型建议为 Integer/Long
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
# 应用名称(在 SkyWalking UI 中显示的服务名)
|
||||
agent.service_name=your-springboot-app
|
||||
# SkyWalking OAP 服务地址(默认本地)
|
||||
collector.backend_service=localhost:11800
|
||||
@ -0,0 +1,6 @@
|
||||
██████╗ ███████╗ ██████╗ ██╗████████╗ ██████╗
|
||||
██╔════╝ ██╔════╝██╔════╝ ██║╚══██╔══╝██╔════╝
|
||||
██║ ███╗█████╗ ██║ ███╗█████╗██║ ██║ ██║
|
||||
██║ ██║██╔══╝ ██║ ██║╚════╝██║ ██║ ██║
|
||||
╚██████╔╝███████╗╚██████╔╝ ██║ ██║ ╚██████╗
|
||||
╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝
|
||||
@ -0,0 +1,49 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos: #nacos监控
|
||||
config:
|
||||
server-addr: 127.0.0.1:8848 # nacos 配置中心地址
|
||||
namespace: ITC-MS
|
||||
group: DNE
|
||||
username: nacos
|
||||
password: nacos
|
||||
extension-configs:
|
||||
- data-id: global-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: discovery-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: datasource-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: seata-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: redis-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: magic-api.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: sa-token.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: camunda.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: sentinel-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
datalog:
|
||||
db:
|
||||
url: jdbc:kingbase8://127.0.0.1:54321/itc?currentSchema=dne_log_sit
|
||||
@ -1,9 +1,13 @@
|
||||
server:
|
||||
port: 8099
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: demo-service
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
|
||||
profiles:
|
||||
active: dev
|
||||
cloud:
|
||||
nacos: #nacos监控
|
||||
config:
|
||||
@ -11,8 +15,9 @@ spring:
|
||||
namespace: ITC-MS
|
||||
group: DNE
|
||||
username: nacos
|
||||
password: ABcd1234@
|
||||
password: Yudean@2025
|
||||
file-extension: yml # 默认配置 ${spring.application.name}-${spring.profiles.active}.${file-extension}
|
||||
refresh-enabled: true
|
||||
extension-configs:
|
||||
- data-id: global.yml
|
||||
refresh: true
|
||||
@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
#cp /etc/hosts /etc/hosts.temp
|
||||
|
||||
# 初始化环境变量(设置默认值,避免空变量)
|
||||
APP_NAME=${APP_NAME:-"default-springboot-app"} # 默认服务名
|
||||
SKYWALKING_SERVER=${SKYWALKING_SERVER:-"localhost:11800"} # 默认SkyWalking服务地址
|
||||
ENV_APP_PRO_FILE=${ENV_APP_PRO_FILE:-"test"} # 默认环境为test
|
||||
|
||||
# 初始化Java启动参数(包含是否使用-server模式)
|
||||
java_base="java -javaagent:/opt/agent/skywalking-agent.jar -Dskywalking.agent.service_name=$APP_NAME"
|
||||
export java_base="$java_base -Dskywalking.collector.backend_service=$SKYWALKING_SERVER"
|
||||
|
||||
java_start="$java_base -jar"
|
||||
|
||||
# 根据环境变量区分开发/生产环境配置
|
||||
if [ "$ENV_APP_PRO_FILE" = "prod" ]; then
|
||||
# 生产环境JVM参数
|
||||
export JAVA_OPTS="-Xms1024m -Xmx4096m -Xmn512m -Xss512k -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC -XX:G1HeapRegionSize=32m -XX:G1ReservePercent=20"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:MaxGCPauseMillis=500 -XX:G1MixedGCCountTarget=10"
|
||||
|
||||
export JAVA_OPTS="$JAVA_OPTS -verbose:gc -Xloggc:/var/log/app/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
|
||||
|
||||
# 生产环境使用-server模式
|
||||
java_start="$java_base -jar -server"
|
||||
else
|
||||
# 开发环境JVM参数
|
||||
export JAVA_OPTS="-Xms512m -Xmx2048m -Xmn256m -Xss512k -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseParNewGC"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled -XX:CMSMaxAbortablePrecleanTime=5000"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseCMSInitiatingOccupancyOnly"
|
||||
export JAVA_OPTS="$JAVA_OPTS -verbose:gc -Xloggc:./logs/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps"
|
||||
# 开发环境开启远程调试
|
||||
export JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
|
||||
fi
|
||||
|
||||
# 公共配置(编码、时区等)
|
||||
export JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8"
|
||||
export JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
|
||||
export JAVA_OPTS="$JAVA_OPTS -Duser.language=zh -Duser.country=CN -Duser.timezone=Asia/Shanghai"
|
||||
|
||||
# SpringBoot 环境配置
|
||||
export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=$ENV_APP_PRO_FILE"
|
||||
|
||||
# 输出启动参数
|
||||
echo "启动参数:$java_start $JAVA_OPTS $ENV_APP_FILE_PATH"
|
||||
|
||||
# 执行启动命令(用双引号包裹每个变量)
|
||||
exec $java_start $JAVA_OPTS $ENV_APP_FILE_PATH
|
||||
@ -0,0 +1,27 @@
|
||||
package com.pictc.constant;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 下午12:00:34
|
||||
* @Description: 合同相关规则引擎常量
|
||||
* 规则引擎的常量包括2个部分,1、规则编码 2、规则节点编码
|
||||
*/
|
||||
public interface ContractLiteflowRule {
|
||||
|
||||
|
||||
String RULE_ARG = "arg";
|
||||
|
||||
/**
|
||||
* 用于演示规则引擎在复杂业务中的使用
|
||||
* 规则节点:test_node_A、test_node_B
|
||||
* 规则参数为:
|
||||
* 参数说明:
|
||||
* */
|
||||
String RULE_TEST = "RULE_TEST";
|
||||
|
||||
String RULE_TEST_NODEA = "test_node_A";
|
||||
|
||||
String RULE_TEST_NODEB = "test_node_B";
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.pictc.enums;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午10:52:42
|
||||
* @Description: 合同业务, 编码范围 11000-11999
|
||||
*/
|
||||
public interface BContractCode {
|
||||
|
||||
//
|
||||
final BusinessCode NOT_FOUNT = BusinessCode.of(11000,"合同【{}】找不到");
|
||||
|
||||
final BusinessCode NOT_VALID = BusinessCode.of(11001,"合同【{}】已经失效");
|
||||
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.pictc.enums;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午10:52:42
|
||||
* @Description: 财务业务,编码范围 16000-16999
|
||||
*/
|
||||
public interface BFinanceCode {
|
||||
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.pictc.enums;
|
||||
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午10:52:42
|
||||
* @Description: 采购业务, 编码范围 12000-12999
|
||||
*/
|
||||
public interface BProcurementCode {
|
||||
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.pictc.enums;
|
||||
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午10:52:42
|
||||
* @Description: 储备业务 15000-15999
|
||||
*/
|
||||
public interface BReserveCode {
|
||||
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.pictc.enums;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午10:52:42
|
||||
* @Description: 销售业务,编码范围 13000-13999
|
||||
*/
|
||||
public interface BSalesCode {
|
||||
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.pictc.enums;
|
||||
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午10:52:42
|
||||
* @Description: 运输业务,编码范围 14000-14999
|
||||
*/
|
||||
public interface BTransportCode {
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.pictc.enums;
|
||||
|
||||
import org.slf4j.helpers.MessageFormatter;
|
||||
|
||||
import com.xjrsoft.common.exception.ExceptionCode;
|
||||
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午10:38:49
|
||||
* @Description:
|
||||
* <div>业务错误编码 </div>
|
||||
* <p> 通用-默认 10000-10500 {@link com.xjrsoft.common.enums.ResponseCode}</p>
|
||||
* <p>通用-参数 10501-10999 {@link com.pictc.enums.ExceptionCommonCode} </p>
|
||||
* <p>合同 11000-11999 {@link com.pictc.enums.BContractCode} </p>
|
||||
* <p>采购 12000-12999 {@link com.pictc.enums.BProcurementCode} </p>
|
||||
* <p>销售 13000-13999 {@link com.pictc.enums.BSalesCode} </p>
|
||||
* <p>运输 14000-14999 {@link com.pictc.enums.BTransportCode} </p>
|
||||
* <p>储备 15000-15999 {@link com.pictc.enums.BReserveCode} </p>
|
||||
* <p>财务 16000-16999 {@link com.pictc.enums.BFinanceCode} </p>
|
||||
*/
|
||||
@Setter
|
||||
public class BusinessCode implements ExceptionCode{
|
||||
|
||||
private int code;
|
||||
|
||||
private String message;
|
||||
|
||||
private BusinessCode(int code, String message) {
|
||||
super();
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public static BusinessCode ofArgs(BusinessCode bcode,Object... args) {
|
||||
String msg = bcode.getMessage();
|
||||
if(args!=null && args.length > 0) {
|
||||
msg = MessageFormatter.arrayFormat(bcode.getMessage(),args).getMessage();
|
||||
}
|
||||
return new BusinessCode(bcode.getCode(),msg);
|
||||
}
|
||||
|
||||
public static BusinessCode of(int code,String msg) {
|
||||
return new BusinessCode(code,msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.pictc.enums;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 下午4:11:24
|
||||
* @Description: 合同业务, 编码范围 10501-10999
|
||||
*/
|
||||
public interface ExceptionCommonCode {
|
||||
|
||||
/**
|
||||
* 数据中某个字段值唯一,不运行重复
|
||||
*/
|
||||
final BusinessCode DATA_FIELD_DUPLICATION = BusinessCode.of(10501,"字段【{}】不允许重复");
|
||||
|
||||
}
|
||||
@ -0,0 +1,166 @@
|
||||
package com.pictc.jdbc;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.URL;
|
||||
import java.sql.Array;
|
||||
import java.sql.Date;
|
||||
import java.sql.NClob;
|
||||
import java.sql.Ref;
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.RowId;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.SQLFeatureNotSupportedException;
|
||||
import java.sql.SQLXML;
|
||||
import java.sql.Struct;
|
||||
import java.sql.Time;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.OffsetTime;
|
||||
import java.time.format.DateTimeParseException;
|
||||
|
||||
import com.pictc.utils.StringUtils;
|
||||
|
||||
public class CallUtils {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T getObject(CallableStatement res,int columnIndex,Class<T> type) throws SQLException {
|
||||
if (type.equals(String.class)) {
|
||||
return (T) res.getString(columnIndex);
|
||||
|
||||
} else if (type.equals(BigDecimal.class)) {
|
||||
return (T) res.getBigDecimal(columnIndex);
|
||||
|
||||
} else if (type.equals(BigInteger.class)) {
|
||||
return (T) getBigInteger(res, columnIndex);
|
||||
|
||||
} else if (type.equals(Boolean.class) || type.equals(Boolean.TYPE)) {
|
||||
return (T) Boolean.valueOf(res.getBoolean(columnIndex));
|
||||
|
||||
} else if (type.equals(Integer.class) || type.equals(Integer.TYPE)) {
|
||||
return (T) Integer.valueOf(res.getInt(columnIndex));
|
||||
|
||||
} else if (type.equals(Long.class) || type.equals(Long.TYPE)) {
|
||||
return (T) Long.valueOf(res.getLong(columnIndex));
|
||||
} else if (type.equals(Float.class) || type.equals(Float.TYPE)) {
|
||||
return (T) Float.valueOf(res.getFloat(columnIndex));
|
||||
|
||||
} else if (type.equals(Double.class) || type.equals(Double.TYPE)) {
|
||||
return (T) Double.valueOf(res.getDouble(columnIndex));
|
||||
|
||||
} else if (type.equals(byte[].class)) {
|
||||
return (T) res.getBytes(columnIndex);
|
||||
|
||||
} else if (type.equals(Date.class)) {
|
||||
return (T) res.getDate(columnIndex);
|
||||
|
||||
} else if (type.equals(Time.class)) {
|
||||
return (T) res.getTime(columnIndex);
|
||||
|
||||
} else if (type.equals(Timestamp.class)) {
|
||||
return (T) res.getTimestamp(columnIndex);
|
||||
|
||||
} else if (type.equals(java.sql.Clob.class)) {
|
||||
return (T) res.getClob(columnIndex);
|
||||
|
||||
} else if (type.equals(java.sql.Blob.class)) {
|
||||
return (T) res.getBlob(columnIndex);
|
||||
|
||||
} else if (type.equals(Array.class)) {
|
||||
return (T) res.getArray(columnIndex);
|
||||
|
||||
} else if (type.equals(Ref.class)) {
|
||||
return (T) res.getRef(columnIndex);
|
||||
|
||||
} else if (type.equals(URL.class)) {
|
||||
return (T) res.getURL(columnIndex);
|
||||
|
||||
} else if (type.equals(Struct.class)) {
|
||||
throw new SQLFeatureNotSupportedException();
|
||||
|
||||
} else if (type.equals(RowId.class)) {
|
||||
return (T) res.getRowId(columnIndex);
|
||||
|
||||
} else if (type.equals(NClob.class)) {
|
||||
return (T) res.getNClob(columnIndex);
|
||||
|
||||
} else if (type.equals(SQLXML.class)) {
|
||||
return (T) res.getSQLXML(columnIndex);
|
||||
|
||||
} else if (type.equals(LocalDate.class)) {
|
||||
return (T) getLocalDate(res,columnIndex);
|
||||
|
||||
} else if (type.equals(LocalDateTime.class)) {
|
||||
return (T) getLocalDateTime(res,columnIndex);
|
||||
|
||||
} else if (type.equals(LocalTime.class)) {
|
||||
return (T) getLocalTime(res,columnIndex);
|
||||
|
||||
} else if (type.equals(OffsetDateTime.class)) {
|
||||
try {
|
||||
String odt = res.getString(columnIndex);
|
||||
return odt == null ? null : (T) OffsetDateTime.parse(odt);
|
||||
} catch (DateTimeParseException e) {
|
||||
// Let it continue and try by object deserialization.
|
||||
}
|
||||
|
||||
} else if (type.equals(OffsetTime.class)) {
|
||||
try {
|
||||
String ot = res.getString(columnIndex);
|
||||
return ot == null ? null : (T) OffsetTime.parse(ot);
|
||||
} catch (DateTimeParseException e) {}
|
||||
}else if(type.isEnum()) {
|
||||
try {
|
||||
String _vl = res.getString(columnIndex);
|
||||
if(!StringUtils.isEmpty(_vl)) {
|
||||
Method method=Enum.class.getMethod("valueOf", String.class);
|
||||
return (T) method.invoke(null,_vl);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return (T) res.getObject(columnIndex);
|
||||
}
|
||||
|
||||
private static LocalDate getLocalDate(CallableStatement res,int columnIndex) throws SQLException {
|
||||
Date date = res.getDate(columnIndex);
|
||||
if(date!=null) {
|
||||
return date.toLocalDate();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static LocalDateTime getLocalDateTime(CallableStatement res,int columnIndex) throws SQLException {
|
||||
Timestamp date = res.getTimestamp(columnIndex);
|
||||
if(date!=null) {
|
||||
return date.toLocalDateTime();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static LocalTime getLocalTime(CallableStatement res,int columnIndex) throws SQLException {
|
||||
Time date = res.getTime(columnIndex);
|
||||
if(date!=null) {
|
||||
return date.toLocalTime();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static BigInteger getBigInteger(CallableStatement res,int columnIndex) throws SQLException {
|
||||
String stringVal = res.getString(columnIndex);
|
||||
if (stringVal == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return new BigInteger(stringVal);
|
||||
} catch (NumberFormatException nfe) {
|
||||
throw new RuntimeException("CallableStatement.Bad_format_for_BigInteger");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -141,17 +141,33 @@ public static final int DEF_STEP = 1000;
|
||||
}
|
||||
}
|
||||
|
||||
private void setOutParams() throws SQLException {
|
||||
if(params!=null) {
|
||||
for (int i = 0; i < params.size(); i++) {
|
||||
JdbcParam parameter = params.get(i);
|
||||
int index = i+1;
|
||||
if(parameter.isOut()) {
|
||||
parameter.setVal(CallUtils.getObject(ctmt, index,parameter.getJavaType()));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int executeUpdate() throws SQLException {
|
||||
executeParams();
|
||||
size = this._executeUpdate();
|
||||
setOutParams();
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
public boolean execute() throws SQLException {
|
||||
executeParams();
|
||||
return this._execute();
|
||||
boolean res = this._execute();
|
||||
setOutParams();
|
||||
return res;
|
||||
}
|
||||
|
||||
public int executeBatch() throws SQLException {
|
||||
|
||||
@ -162,6 +162,23 @@ public class JdbcTools {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行存储过程返回基础数据类型
|
||||
* */
|
||||
public static void call(String sql,List<JdbcParam> params){
|
||||
JdbcContext context = null;
|
||||
try {
|
||||
context = new JdbcContext(true);
|
||||
context.initCall(sql);
|
||||
context.setParams(params);
|
||||
context.execute();
|
||||
} catch (SQLException e) {
|
||||
throw context.createException(e);
|
||||
}finally {
|
||||
context.end();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行存储过程返回基础数据类型
|
||||
* */
|
||||
|
||||
@ -33,7 +33,7 @@ public class JdbcParam implements Serializable{
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return val+"("+JdbcType.valueOf(jdbc).name()+")";
|
||||
return (out?"OUT ":"IN ")+val+"("+JdbcType.valueOf(jdbc).name()+")";
|
||||
}
|
||||
|
||||
public static JdbcParam ofOut(int jdbc,Class<?> javaType) {
|
||||
@ -161,5 +161,110 @@ public class JdbcParam implements Serializable{
|
||||
.setVal(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取String类型值
|
||||
*/
|
||||
public String getStringValue() {
|
||||
return val == null ? null : String.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Integer类型值
|
||||
*/
|
||||
public Integer getIntValue() {
|
||||
return val == null ? null : Integer.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Long类型值
|
||||
*/
|
||||
public Long getLongValue() {
|
||||
return val == null ? null : Long.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Boolean类型值
|
||||
*/
|
||||
public Boolean getBooleanValue() {
|
||||
return val == null ? null : Boolean.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Float类型值
|
||||
*/
|
||||
public Float getFloatValue() {
|
||||
return val == null ? null : Float.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Double类型值
|
||||
*/
|
||||
public Double getDoubleValue() {
|
||||
return val == null ? null : Double.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Byte类型值
|
||||
*/
|
||||
public Byte getByteValue() {
|
||||
return val == null ? null : Byte.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Short类型值
|
||||
*/
|
||||
public Short getShortValue() {
|
||||
return val == null ? null : Short.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Date类型值
|
||||
*/
|
||||
public Date getDateValue() {
|
||||
return val == null ? null : Date.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Timestamp类型值
|
||||
*/
|
||||
public Timestamp getTimestampValue() {
|
||||
return val == null ? null : Timestamp.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取BigDecimal类型值
|
||||
*/
|
||||
public BigDecimal getBigDecimalValue() {
|
||||
return val == null ? null : BigDecimal.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取BigInteger类型值
|
||||
*/
|
||||
public BigInteger getBigIntegerValue() {
|
||||
return val == null ? null : BigInteger.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取LocalDate类型值
|
||||
*/
|
||||
public LocalDate getLocalDateValue() {
|
||||
return val == null ? null : LocalDate.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取LocalTime类型值
|
||||
*/
|
||||
public LocalTime getLocalTimeValue() {
|
||||
return val == null ? null : LocalTime.class.cast(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取LocalDateTime类型值
|
||||
*/
|
||||
public LocalDateTime getLocalDateTimeValue() {
|
||||
return val == null ? null : LocalDateTime.class.cast(val);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,104 @@
|
||||
package com.xjrsoft.module.common.db.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.pictc.jdbc.JdbcTools;
|
||||
import com.pictc.jdbc.model.JdbcParam;
|
||||
import com.pictc.utils.ListUtils;
|
||||
import com.pictc.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午11:47:59
|
||||
* @Description: 通用保存、删除、启用、作废存储过程调用
|
||||
* 通用 CommonCallService
|
||||
* 合同 ContractCallService
|
||||
* 采购 ProcurementCallService
|
||||
* 销售 SalesCallService
|
||||
* 运输 TransportCallService
|
||||
* 储备 ReserveCallService
|
||||
* 财务 FinanceCallService
|
||||
*/
|
||||
@Component
|
||||
public class CommonCallService {
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
一、新增、修改记录时,在同一个事务里执行如下过程:
|
||||
1、更新表;
|
||||
2、调用数据库函数pc_表名.f_save(表主键);
|
||||
3、函数返回非空、或者数据库异常时rollback,函数返回空时commit;
|
||||
* @param table 表名
|
||||
* @param id 表主键
|
||||
* @return String 返回类型 函数返回非空、或者数据库异常时rollback,函数返回空时commit;
|
||||
*/
|
||||
public String saveAfter(String table,Long id) {
|
||||
String sql = StringUtils.format("{? = call pc_{0}.f_save(?)}",table);
|
||||
List<JdbcParam> params = ListUtils.newArrayList(JdbcParam.ofLong(id));
|
||||
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||
params.add(outParam);
|
||||
params.add(JdbcParam.ofLong(id));
|
||||
JdbcTools.call(sql,params);
|
||||
return outParam.getStringValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
二、删除记录时,在同一个事务里执行如下过程:
|
||||
1、调用数据库函数pc_表名.f_delete(表主键);
|
||||
2、函数返回非空、或者数据库异常时rollback,函数返回空时commit;
|
||||
* @return
|
||||
* @return String 返回类型
|
||||
*/
|
||||
public String deleteBefore(String table,Long id) {
|
||||
String sql = StringUtils.format("{? = call pc_{0}.f_delete(?)}",table);
|
||||
List<JdbcParam> params = ListUtils.newArrayList(JdbcParam.ofLong(id));
|
||||
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||
params.add(outParam);
|
||||
params.add(JdbcParam.ofLong(id));
|
||||
JdbcTools.call(sql,params);
|
||||
return outParam.getStringValue();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
二、停用时,在同一个事务里执行如下过程:
|
||||
1、调用数据库函数pc_表名.f_off(表主键);
|
||||
2、函数返回非空、或者数据库异常时rollback,函数返回空时commit;
|
||||
* @return
|
||||
* @return String 返回类型
|
||||
*/
|
||||
public String disableBefore(String table,Long id) {
|
||||
String sql = StringUtils.format("{? = call pc_{0}.f_off(?)}",table);
|
||||
List<JdbcParam> params = ListUtils.newArrayList(JdbcParam.ofLong(id));
|
||||
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||
params.add(outParam);
|
||||
params.add(JdbcParam.ofLong(id));
|
||||
JdbcTools.call(sql,params);
|
||||
return outParam.getStringValue();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
1、调用数据库函数pc_表名.f_on(表主键);
|
||||
2、函数返回非空、或者数据库异常时rollback,函数返回空时commit;
|
||||
* @return
|
||||
* @return String 返回类型
|
||||
*/
|
||||
public String enableBefore(String table,Long id) {
|
||||
String sql = StringUtils.format("{? = call pc_{0}.f_on(?)}",table);
|
||||
List<JdbcParam> params = ListUtils.newArrayList(JdbcParam.ofLong(id));
|
||||
JdbcParam outParam = JdbcParam.ofString(null).setOut(true);
|
||||
params.add(outParam);
|
||||
params.add(JdbcParam.ofLong(id));
|
||||
JdbcTools.call(sql,params);
|
||||
return outParam.getStringValue();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package com.xjrsoft.module.common.db.service;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午11:47:59
|
||||
* @Description: 合同相关的存储过程
|
||||
*/
|
||||
@Component
|
||||
public class ContractCallService {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.xjrsoft.module.common.db.service;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午11:47:59
|
||||
* @Description: 财务相关的存储过程
|
||||
*/
|
||||
@Component
|
||||
public class FinanceCallService {
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package com.xjrsoft.module.common.db.service;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午11:47:59
|
||||
* @Description: 采购相关的存储过程
|
||||
*/
|
||||
@Component
|
||||
public class ProcurementCallService {
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package com.xjrsoft.module.common.db.service;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午11:47:59
|
||||
* @Description: 储备相关的存储过程
|
||||
*/
|
||||
@Component
|
||||
public class ReserveCallService {
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package com.xjrsoft.module.common.db.service;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午11:47:59
|
||||
* @Description: 销售相关的存储过程
|
||||
*/
|
||||
@Component
|
||||
public class SalesCallService {
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
package com.xjrsoft.module.common.db.service;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author 张福财
|
||||
* @date 2025年10月14日 上午11:47:59
|
||||
* @Description: 运输相关的存储过程
|
||||
*/
|
||||
@Component
|
||||
public class TransportCallService {
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
# src/main/resources/META-INF/spring.factories
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.pictc.config.PcitcAutoConfig,\
|
||||
com.pictc.config.JdbcConfig
|
||||
@ -0,0 +1 @@
|
||||
component=com.pictc
|
||||
@ -0,0 +1,9 @@
|
||||
|
||||
███████ ██████ ██ ██████████ ██████
|
||||
░██░░░░██ ██░░░░██░██░░░░░██░░░ ██░░░░██
|
||||
░██ ░██ ██ ░░ ░██ ░██ ██ ░░ 服务名称:${serverName}
|
||||
░███████ ░██ ░██ ░██ ░██ 启动环境:${profiles}
|
||||
░██░░░░ ░██ ░██ ░██ ░██ 启动耗时:${time}s
|
||||
░██ ░░██ ██░██ ░██ ░░██ ██ 访问地址:${url}
|
||||
░██ ░░██████ ░██ ░██ ░░██████
|
||||
░░ ░░░░░░ ░░ ░░ ░░░░░░
|
||||
@ -6,13 +6,13 @@
|
||||
|
||||
<parent>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>demo</artifactId>
|
||||
<artifactId>itc-pcitc-mdm</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>demo-api</artifactId>
|
||||
<name>demo-api</name>
|
||||
<description>demo-api</description>
|
||||
<artifactId>itc-pcitc-mdm-api</artifactId>
|
||||
<name>itc-pcitc-mdm-api</name>
|
||||
<description>itc-pcitc-mdm-api</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
@ -22,35 +22,12 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-common-api</artifactId>
|
||||
<version>${framework.version}</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>
|
||||
<artifactId>itc-pcitc-dependencies-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
118
itc-pcitc-mdm/itc-pcitc-mdm-service/pom.xml
Normal file
118
itc-pcitc-mdm/itc-pcitc-mdm-service/pom.xml
Normal 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-mdm</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>itc-pcitc-mdm-service</artifactId>
|
||||
<name>itc-pcitc-mdm-service</name>
|
||||
<description>itc-pcitc-mdm-service</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<docker-image-name>pcitc/itc-pcitc-mdm</docker-image-name>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-pcitc-dependencies-service</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-system-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-facade-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-common-service</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>itc-ms-workflow-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-pcitc-mdm-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</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>
|
||||
@ -0,0 +1,4 @@
|
||||
# 应用名称(在 SkyWalking UI 中显示的服务名)
|
||||
agent.service_name=your-springboot-app
|
||||
# SkyWalking OAP 服务地址(默认本地)
|
||||
collector.backend_service=localhost:11800
|
||||
@ -0,0 +1,50 @@
|
||||
#!/bin/sh
|
||||
#cp /etc/hosts /etc/hosts.temp
|
||||
|
||||
# 初始化环境变量(设置默认值,避免空变量)
|
||||
APP_NAME=${APP_NAME:-"default-springboot-app"} # 默认服务名
|
||||
SKYWALKING_SERVER=${SKYWALKING_SERVER:-"localhost:11800"} # 默认SkyWalking服务地址
|
||||
ENV_APP_PRO_FILE=${ENV_APP_PRO_FILE:-"test"} # 默认环境为test
|
||||
|
||||
# 初始化Java启动参数(包含是否使用-server模式)
|
||||
java_base="java -javaagent:/opt/agent/skywalking-agent.jar -Dskywalking.agent.service_name=$APP_NAME"
|
||||
export java_base="$java_base -Dskywalking.collector.backend_service=$SKYWALKING_SERVER"
|
||||
|
||||
java_start="$java_base -jar"
|
||||
|
||||
# 根据环境变量区分开发/生产环境配置
|
||||
if [ "$ENV_APP_PRO_FILE" = "prod" ]; then
|
||||
# 生产环境JVM参数
|
||||
export JAVA_OPTS="-Xms1024m -Xmx4096m -Xmn512m -Xss512k -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC -XX:G1HeapRegionSize=32m -XX:G1ReservePercent=20"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:MaxGCPauseMillis=500 -XX:G1MixedGCCountTarget=10"
|
||||
|
||||
export JAVA_OPTS="$JAVA_OPTS -verbose:gc -Xloggc:/var/log/app/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M"
|
||||
|
||||
# 生产环境使用-server模式
|
||||
java_start="$java_base -jar -server"
|
||||
else
|
||||
# 开发环境JVM参数
|
||||
export JAVA_OPTS="-Xms512m -Xmx2048m -Xmn256m -Xss512k -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseParNewGC"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled -XX:CMSMaxAbortablePrecleanTime=5000"
|
||||
export JAVA_OPTS="$JAVA_OPTS -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseCMSInitiatingOccupancyOnly"
|
||||
export JAVA_OPTS="$JAVA_OPTS -verbose:gc -Xloggc:./logs/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps"
|
||||
# 开发环境开启远程调试
|
||||
export JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
|
||||
fi
|
||||
|
||||
# 公共配置(编码、时区等)
|
||||
export JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8"
|
||||
export JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
|
||||
export JAVA_OPTS="$JAVA_OPTS -Duser.language=zh -Duser.country=CN -Duser.timezone=Asia/Shanghai"
|
||||
|
||||
# SpringBoot 环境配置
|
||||
export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=$ENV_APP_PRO_FILE"
|
||||
|
||||
# 输出启动参数
|
||||
echo "启动参数:$java_start $JAVA_OPTS $ENV_APP_FILE_PATH"
|
||||
|
||||
# 执行启动命令(用双引号包裹每个变量)
|
||||
exec $java_start $JAVA_OPTS $ENV_APP_FILE_PATH
|
||||
@ -1,25 +1,28 @@
|
||||
package com.xjrsoft;
|
||||
|
||||
import com.xjrsoft.common.annotation.UniqueNameGenerator;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
|
||||
import com.pictc.utils.SpringTools;
|
||||
import com.xjrsoft.common.annotation.UniqueNameGenerator;
|
||||
|
||||
/**
|
||||
* @author Zexy
|
||||
* @author 张福财
|
||||
* 主数据服务---开发使用
|
||||
* 使用时集成到其它模块使用,不作为单独的服务
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableAspectJAutoProxy(exposeProxy = true)
|
||||
@ComponentScan(nameGenerator = UniqueNameGenerator.class)
|
||||
@EnableFeignClients
|
||||
@EnableDiscoveryClient
|
||||
public class ITCFacadeApplication {
|
||||
public class ITCMdmApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ITCFacadeApplication.class, args);
|
||||
SpringTools.logStarter(ITCMdmApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
██████╗ ███████╗ ██████╗ ██╗████████╗ ██████╗
|
||||
██╔════╝ ██╔════╝██╔════╝ ██║╚══██╔══╝██╔════╝
|
||||
██║ ███╗█████╗ ██║ ███╗█████╗██║ ██║ ██║
|
||||
██║ ██║██╔══╝ ██║ ██║╚════╝██║ ██║ ██║
|
||||
╚██████╔╝███████╗╚██████╔╝ ██║ ██║ ╚██████╗
|
||||
╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝
|
||||
@ -0,0 +1,49 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos: #nacos监控
|
||||
config:
|
||||
server-addr: 127.0.0.1:8848 # nacos 配置中心地址
|
||||
namespace: ITC-MS
|
||||
group: DNE
|
||||
username: nacos
|
||||
password: nacos
|
||||
extension-configs:
|
||||
- data-id: global-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: discovery-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: datasource-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: seata-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: redis-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: magic-api.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: sa-token.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: camunda.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: sentinel-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
datalog:
|
||||
db:
|
||||
url: jdbc:kingbase8://127.0.0.1:54321/itc?currentSchema=dne_log_sit
|
||||
@ -1,9 +1,13 @@
|
||||
server:
|
||||
port: 8099
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: facade-service
|
||||
name: demo-service
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
|
||||
profiles:
|
||||
active: dev
|
||||
cloud:
|
||||
nacos: #nacos监控
|
||||
config:
|
||||
@ -11,8 +15,9 @@ spring:
|
||||
namespace: ITC-MS
|
||||
group: DNE
|
||||
username: nacos
|
||||
password: ABcd1234@
|
||||
password: Yudean@2025
|
||||
file-extension: yml # 默认配置 ${spring.application.name}-${spring.profiles.active}.${file-extension}
|
||||
refresh-enabled: true
|
||||
extension-configs:
|
||||
- data-id: global.yml
|
||||
refresh: true
|
||||
@ -0,0 +1,49 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos: #nacos监控
|
||||
config:
|
||||
server-addr: 127.0.0.1:8848 # nacos 配置中心地址
|
||||
namespace: ITC-MS
|
||||
group: DNE
|
||||
username: nacos
|
||||
password: nacos
|
||||
extension-configs:
|
||||
- data-id: global-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: discovery-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: datasource-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: seata-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: redis-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: magic-api.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: sa-token.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: camunda.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: sentinel-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
datalog:
|
||||
db:
|
||||
url: jdbc:kingbase8://127.0.0.1:54321/itc?currentSchema=dne_log_sit
|
||||
@ -0,0 +1,56 @@
|
||||
server:
|
||||
port: 8099
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: demo-service
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
profiles:
|
||||
active: dev
|
||||
cloud:
|
||||
nacos: #nacos监控
|
||||
config:
|
||||
server-addr: 10.0.252.1:8848 # nacos 配置中心地址
|
||||
namespace: ITC-MS
|
||||
group: DNE
|
||||
username: nacos
|
||||
password: Yudean@2025
|
||||
file-extension: yml # 默认配置 ${spring.application.name}-${spring.profiles.active}.${file-extension}
|
||||
refresh-enabled: true
|
||||
extension-configs:
|
||||
- data-id: global.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: discovery.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: datasource.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: seata.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: redis.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: magic-api.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: sa-token.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: camunda.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: sentinel.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
@ -6,18 +6,18 @@
|
||||
|
||||
<parent>
|
||||
<groupId>com.geg</groupId>
|
||||
<artifactId>ms-demo</artifactId>
|
||||
<artifactId>itc-pcitc-back</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>demo</artifactId>
|
||||
<name>demo</name>
|
||||
<description>demo</description>
|
||||
<artifactId>itc-pcitc-mdm</artifactId>
|
||||
<name>itc-pcitc-mdm</name>
|
||||
<description>itc-pcitc-mdm</description>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>demo-api</module>
|
||||
<module>demo-service</module>
|
||||
<module>itc-pcitc-mdm-service</module>
|
||||
<module>itc-pcitc-mdm-api</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
@ -25,5 +25,4 @@
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
Reference in New Issue
Block a user