1. 手动合并存在重复被合并的文件,并统一包名
This commit is contained in:
24
zt-module-template/pom.xml
Normal file
24
zt-module-template/pom.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<artifactId>zt</artifactId>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modules>
|
||||
<module>zt-module-template-api</module>
|
||||
<module>zt-module-template-server</module>
|
||||
</modules>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>zt-module-template</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
样例模块。
|
||||
</description>
|
||||
|
||||
</project>
|
||||
46
zt-module-template/zt-module-template-api/pom.xml
Normal file
46
zt-module-template/zt-module-template-api/pom.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<artifactId>zt-module-template</artifactId>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>zt-module-template-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-common</artifactId>
|
||||
</dependency>
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId> <!-- 接口文档:使用最新版本的 Swagger 模型 -->
|
||||
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.zt.plat.module.template.enums;
|
||||
|
||||
import com.zt.plat.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* Template 错误码枚举类
|
||||
* Template 系统,使用 1_100_000_000 段
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 模板样例 1_100_000_000 ==========
|
||||
ErrorCode EXAMPLE_NOT_EXISTS = new ErrorCode(1_100_000_000, "模板样例不存在");
|
||||
// ========== 合同 补充编号 ==========
|
||||
ErrorCode DEMO_CONTRACT_NOT_EXISTS = new ErrorCode(2_100_000_000, "合同不存在");
|
||||
|
||||
// ========== 虚拟化表格 1_100_000_001 ==========
|
||||
ErrorCode DEMO_VIRTUALIZED_TABLE_NOT_EXISTS = new ErrorCode(1_100_000_001, "虚拟化表格不存在");
|
||||
|
||||
}
|
||||
19
zt-module-template/zt-module-template-server/Dockerfile
Normal file
19
zt-module-template/zt-module-template-server/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
## AdoptOpenJDK 停止发布 OpenJDK 二进制,而 Eclipse Temurin 是它的延伸,提供更好的稳定性
|
||||
|
||||
FROM 172.16.46.66:10043/base-service/eclipse-temurin:21-jre
|
||||
|
||||
## 创建目录,并使用它作为工作目录
|
||||
RUN mkdir -p /zt-module-template-server
|
||||
WORKDIR /zt-module-template-server
|
||||
## 将后端项目的 Jar 文件,复制到镜像中
|
||||
COPY ./target/zt-module-template-server.jar app.jar
|
||||
|
||||
## 设置 TZ 时区
|
||||
## 设置 JAVA_OPTS 环境变量,可通过 docker run -e "JAVA_OPTS=" 进行覆盖
|
||||
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms512m -Xmx512m"
|
||||
|
||||
## 暴露后端项目的 48080 端口
|
||||
EXPOSE 48100
|
||||
|
||||
## 启动后端项目
|
||||
CMD java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar app.jar
|
||||
150
zt-module-template/zt-module-template-server/pom.xml
Normal file
150
zt-module-template/zt-module-template-server/pom.xml
Normal file
@@ -0,0 +1,150 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<artifactId>zt-module-template</artifactId>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<artifactId>zt-module-template-server</artifactId>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
样例模块。
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- Spring Cloud 基础 -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-env</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 依赖服务 -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-module-system-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-module-infra-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-module-template-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-biz-data-permission</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-rpc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Registry 注册中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Config 配置中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Job 定时任务相关 -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-job</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 消息队列相关 -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 监控相关 -->
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-monitor</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-spring-boot-starter-biz-business</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<!-- 设置构建的 jar 包名 -->
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<!-- 打包 -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal> <!-- 将引入的 jar 打入其中 -->
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.zt.plat.module.template;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 项目的启动类
|
||||
*
|
||||
* @author 周迪
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class TemplateServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(TemplateServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.zt.plat.module.template.controller.admin.contract;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.infra.api.businessfile.BusinessFileApi;
|
||||
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFilePageReqDTO;
|
||||
import com.zt.plat.module.system.api.dept.DeptApi;
|
||||
import com.zt.plat.module.system.api.dept.dto.CompanyDeptInfoRespDTO;
|
||||
import com.zt.plat.module.template.controller.admin.contract.vo.DemoContractPageReqVO;
|
||||
import com.zt.plat.module.template.controller.admin.contract.vo.DemoContractRespVO;
|
||||
import com.zt.plat.module.template.controller.admin.contract.vo.DemoContractSaveReqVO;
|
||||
import com.zt.plat.module.template.dal.dataobject.contract.DemoContractDO;
|
||||
import com.zt.plat.module.template.service.contract.DemoContractService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
import static com.zt.plat.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Tag(name = "管理后台 - 合同")
|
||||
@RestController
|
||||
@RequestMapping("/template/demo-contract")
|
||||
@Validated
|
||||
@FileUploadController(source = "template.contract")
|
||||
public class DemoContractController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = DemoContractController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private DemoContractService demoContractService;
|
||||
|
||||
@Resource
|
||||
private BusinessFileApi businessFileApi;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建合同")
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-contract:create')")
|
||||
public CommonResult<DemoContractRespVO> createDemoContract(@Valid @RequestBody DemoContractSaveReqVO createReqVO) {
|
||||
return success(demoContractService.createDemoContract(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新合同")
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-contract:update')")
|
||||
public CommonResult<Boolean> updateDemoContract(@Valid @RequestBody DemoContractSaveReqVO updateReqVO) {
|
||||
demoContractService.updateDemoContract(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除合同")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-contract:delete')")
|
||||
public CommonResult<Boolean> deleteDemoContract(@RequestParam("id") Long id) {
|
||||
demoContractService.deleteDemoContract(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除合同")
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-contract:delete')")
|
||||
public CommonResult<Boolean> deleteDemoContractList(@RequestBody BatchDeleteReqVO req) {
|
||||
demoContractService.deleteDemoContractListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得合同")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-contract:query')")
|
||||
public CommonResult<DemoContractRespVO> getDemoContract(@RequestParam("id") Long id) {
|
||||
DemoContractDO demoContract = demoContractService.getDemoContract(id);
|
||||
return success(BeanUtils.toBean(demoContract, DemoContractRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得合同分页")
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-contract:query')")
|
||||
public CommonResult<PageResult<DemoContractRespVO>> getDemoContractPage(@Valid DemoContractPageReqVO pageReqVO) {
|
||||
BusinessFilePageReqDTO pageReqDTO = new BusinessFilePageReqDTO();
|
||||
CommonResult<Set<CompanyDeptInfoRespDTO>> companyDeptInfoListByUserId = deptApi.getCompanyDeptInfoListByUserId(getLoginUserId());
|
||||
Long id = IdWorker.getId();
|
||||
System.out.println("Generated ID: " + id);
|
||||
PageResult<DemoContractDO> pageResult = demoContractService.getDemoContractPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DemoContractRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出合同 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-contract:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDemoContractExcel(@Valid DemoContractPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DemoContractDO> list = demoContractService.getDemoContractPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "合同.xls", "数据", DemoContractRespVO.class,
|
||||
BeanUtils.toBean(list, DemoContractRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.zt.plat.module.template.controller.admin.contract.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 合同分页 Request VO")
|
||||
@Data
|
||||
public class DemoContractPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "合同编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "合同名称", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同状态", example = "1")
|
||||
private Short status;
|
||||
|
||||
@Schema(description = "流程实例ID", example = "7282")
|
||||
private Long processInstanceId;
|
||||
|
||||
@Schema(description = "签订日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] signDate;
|
||||
|
||||
@Schema(description = "合同开始日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] startDate;
|
||||
|
||||
@Schema(description = "合同结束日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] endDate;
|
||||
|
||||
@Schema(description = "合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "岗位ID", example = "26779")
|
||||
private Long postId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.zt.plat.module.template.controller.admin.contract.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 合同 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DemoContractRespVO {
|
||||
|
||||
@Schema(description = "合同ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29614")
|
||||
@ExcelProperty("合同ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同编号")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@ExcelProperty("合同名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "合同状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("合同状态")
|
||||
private Short status;
|
||||
|
||||
@Schema(description = "流程实例ID", example = "7282")
|
||||
@ExcelProperty("流程实例ID")
|
||||
private Long processInstanceId;
|
||||
|
||||
@Schema(description = "签订日期")
|
||||
@ExcelProperty("签订日期")
|
||||
private LocalDateTime signDate;
|
||||
|
||||
@Schema(description = "合同开始日期")
|
||||
@ExcelProperty("合同开始日期")
|
||||
private LocalDateTime startDate;
|
||||
|
||||
@Schema(description = "合同结束日期")
|
||||
@ExcelProperty("合同结束日期")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("合同金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "公司ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9176")
|
||||
@ExcelProperty("公司ID")
|
||||
private Long companyId;
|
||||
|
||||
@Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("公司名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23987")
|
||||
@ExcelProperty("部门ID")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "岗位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26779")
|
||||
@ExcelProperty("岗位ID")
|
||||
private Long postId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.zt.plat.module.template.controller.admin.contract.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 合同新增/修改 Request VO")
|
||||
@Data
|
||||
public class DemoContractSaveReqVO {
|
||||
|
||||
@Schema(description = "合同ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29614")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@NotEmpty(message = "合同名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "签订日期")
|
||||
private LocalDateTime signDate;
|
||||
|
||||
@Schema(description = "合同开始日期")
|
||||
private LocalDateTime startDate;
|
||||
|
||||
@Schema(description = "合同结束日期")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
@Schema(description = "合同金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "合同金额不能为空")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "岗位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26779")
|
||||
@NotNull(message = "岗位ID不能为空")
|
||||
private Long postId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.zt.plat.module.template.controller.admin.example;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.template.controller.admin.example.vo.ExamplePageReqVO;
|
||||
import com.zt.plat.module.template.controller.admin.example.vo.ExampleRespVO;
|
||||
import com.zt.plat.module.template.controller.admin.example.vo.ExampleSaveReqVO;
|
||||
import com.zt.plat.module.template.dal.dataobject.example.ExampleDO;
|
||||
import com.zt.plat.module.template.service.example.ExampleService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 模板样例")
|
||||
@RestController
|
||||
@RequestMapping("/template/example")
|
||||
@Validated
|
||||
public class ExampleController {
|
||||
|
||||
@Resource
|
||||
private ExampleService exampleService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模板样例")
|
||||
@PreAuthorize("@ss.hasPermission('template:example:create')")
|
||||
public CommonResult<Long> createExample(@Valid @RequestBody ExampleSaveReqVO createReqVO) {
|
||||
return success(exampleService.createExample(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模板样例")
|
||||
@PreAuthorize("@ss.hasPermission('template:example:update')")
|
||||
public CommonResult<Boolean> updateExample(@Valid @RequestBody ExampleSaveReqVO updateReqVO) {
|
||||
exampleService.updateExample(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模板样例")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('template:example:delete')")
|
||||
public CommonResult<Boolean> deleteExample(@RequestParam("id") Long id) {
|
||||
exampleService.deleteExample(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除模板样例")
|
||||
@PreAuthorize("@ss.hasPermission('template:example:delete')")
|
||||
public CommonResult<Boolean> deleteExampleList(@RequestParam("ids") List<Long> ids) {
|
||||
exampleService.deleteExampleListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得模板样例")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('template:example:query')")
|
||||
public CommonResult<ExampleRespVO> getExample(@RequestParam("id") Long id) {
|
||||
ExampleDO example = exampleService.getExample(id);
|
||||
return success(BeanUtils.toBean(example, ExampleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模板样例分页")
|
||||
@PreAuthorize("@ss.hasPermission('template:example:query')")
|
||||
public CommonResult<PageResult<ExampleRespVO>> getExamplePage(@Valid ExamplePageReqVO pageReqVO) {
|
||||
PageResult<ExampleDO> pageResult = exampleService.getExamplePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ExampleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出模板样例 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('template:example:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportExampleExcel(@Valid ExamplePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ExampleDO> list = exampleService.getExamplePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "模板样例.xls", "数据", ExampleRespVO.class,
|
||||
BeanUtils.toBean(list, ExampleRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.zt.plat.module.template.controller.admin.example.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模板样例分页 Request VO")
|
||||
@Data
|
||||
public class ExamplePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "字符串")
|
||||
private String strTemp;
|
||||
|
||||
@Schema(description = "整数")
|
||||
private Integer intTemp;
|
||||
|
||||
@Schema(description = "小整数")
|
||||
private Short sintTemp;
|
||||
|
||||
@Schema(description = "布尔值")
|
||||
private Boolean bitTemp;
|
||||
|
||||
@Schema(description = "数值类型")
|
||||
private BigDecimal decimalTemp;
|
||||
|
||||
@Schema(description = "日期类型")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate dateTemp;
|
||||
|
||||
@Schema(description = "时间类型")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime datetimeTemp;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.zt.plat.module.template.controller.admin.example.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模板样例 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ExampleRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24968")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "字符串")
|
||||
@ExcelProperty("字符串")
|
||||
private String strTemp;
|
||||
|
||||
@Schema(description = "整数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("整数")
|
||||
private Integer intTemp;
|
||||
|
||||
@Schema(description = "小整数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("小整数")
|
||||
private Short sintTemp;
|
||||
|
||||
@Schema(description = "布尔值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("布尔值")
|
||||
private Boolean bitTemp;
|
||||
|
||||
@Schema(description = "数值类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("数值类型")
|
||||
private BigDecimal decimalTemp;
|
||||
|
||||
@Schema(description = "日期类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("日期类型")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate dateTemp;
|
||||
|
||||
@Schema(description = "时间类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("时间类型")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime datetimeTemp;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.zt.plat.module.template.controller.admin.example.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.*;
|
||||
|
||||
@Schema(description = "管理后台 - 模板样例新增/修改 Request VO")
|
||||
@Data
|
||||
public class ExampleSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "24968")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "字符串")
|
||||
private String strTemp;
|
||||
|
||||
@Schema(description = "整数")
|
||||
// @NotNull(message = "整数不能为空")
|
||||
private Integer intTemp;
|
||||
|
||||
@Schema(description = "小整数")
|
||||
// @NotNull(message = "小整数不能为空")
|
||||
private Short sintTemp;
|
||||
|
||||
@Schema(description = "布尔值")
|
||||
// @NotNull(message = "布尔值不能为空")
|
||||
private Boolean bitTemp;
|
||||
|
||||
@Schema(description = "数值类型")
|
||||
// @NotNull(message = "数值类型不能为空")
|
||||
private BigDecimal decimalTemp;
|
||||
|
||||
@Schema(description = "日期类型")
|
||||
// @NotNull(message = "日期类型不能为空")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate dateTemp;
|
||||
|
||||
@Schema(description = "时间类型")
|
||||
// @NotNull(message = "时间类型不能为空")
|
||||
@JsonFormat(timezone = TIME_ZONE_DEFAULT, pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime datetimeTemp;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.zt.plat.module.template.controller.admin.virtualizedtable;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.template.controller.admin.virtualizedtable.vo.DemoVirtualizedTablePageReqVO;
|
||||
import com.zt.plat.module.template.controller.admin.virtualizedtable.vo.DemoVirtualizedTableRespVO;
|
||||
import com.zt.plat.module.template.controller.admin.virtualizedtable.vo.DemoVirtualizedTableSaveReqVO;
|
||||
import com.zt.plat.module.template.convert.virtualizedtable.DemoVirtualizedTableConvert;
|
||||
import com.zt.plat.module.template.dal.dataobject.virtualizedtable.DemoVirtualizedTableDO;
|
||||
import com.zt.plat.module.template.service.virtualizedtable.DemoVirtualizedTableService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 虚拟表格测试")
|
||||
@RestController
|
||||
@RequestMapping("/template/demo-virtualized-table")
|
||||
@Validated
|
||||
public class DemoVirtualizedTableController {
|
||||
|
||||
|
||||
@Resource
|
||||
private DemoVirtualizedTableService demoVirtualizedTableService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建虚拟表格测试")
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-virtualized-table:create')")
|
||||
public CommonResult<DemoVirtualizedTableRespVO> createDemoVirtualizedTable(@Valid @RequestBody DemoVirtualizedTableSaveReqVO createReqVO) {
|
||||
return success(demoVirtualizedTableService.createDemoVirtualizedTable(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新虚拟表格测试")
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-virtualized-table:update')")
|
||||
public CommonResult<Boolean> updateDemoVirtualizedTable(@Valid @RequestBody DemoVirtualizedTableSaveReqVO updateReqVO) {
|
||||
demoVirtualizedTableService.updateDemoVirtualizedTable(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除虚拟表格测试")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-virtualized-table:delete')")
|
||||
public CommonResult<Boolean> deleteDemoVirtualizedTable(@RequestParam("id") Long id) {
|
||||
demoVirtualizedTableService.deleteDemoVirtualizedTable(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除虚拟表格测试")
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-virtualized-table:delete')")
|
||||
public CommonResult<Boolean> deleteDemoVirtualizedTableList(@RequestBody BatchDeleteReqVO req) {
|
||||
demoVirtualizedTableService.deleteDemoVirtualizedTableListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得虚拟表格测试")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-virtualized-table:query')")
|
||||
public CommonResult<DemoVirtualizedTableRespVO> getDemoVirtualizedTable(@RequestParam("id") Long id) {
|
||||
DemoVirtualizedTableDO demoVirtualizedTable = demoVirtualizedTableService.getDemoVirtualizedTable(id);
|
||||
return success(BeanUtils.toBean(demoVirtualizedTable, DemoVirtualizedTableRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得虚拟表格测试分页")
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-virtualized-table:query')")
|
||||
public CommonResult<PageResult<DemoVirtualizedTableRespVO>> getDemoVirtualizedTablePage(@Valid DemoVirtualizedTablePageReqVO pageReqVO) {
|
||||
PageResult<DemoVirtualizedTableDO> pageResult = demoVirtualizedTableService.getDemoVirtualizedTablePage(pageReqVO);
|
||||
PageResult<DemoVirtualizedTableRespVO> convert = DemoVirtualizedTableConvert.INSTANCE.convert(pageResult);
|
||||
return success(convert);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出虚拟表格测试 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('template:demo-virtualized-table:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDemoVirtualizedTableExcel(@Valid DemoVirtualizedTablePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DemoVirtualizedTableDO> list = demoVirtualizedTableService.getDemoVirtualizedTablePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "虚拟表格测试.xls", "数据", DemoVirtualizedTableRespVO.class,
|
||||
BeanUtils.toBean(list, DemoVirtualizedTableRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.zt.plat.module.template.controller.admin.virtualizedtable.vo;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 虚拟表格测试分页 Request VO")
|
||||
@Data
|
||||
public class DemoVirtualizedTablePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "COL_1")
|
||||
private String col1;
|
||||
|
||||
@Schema(description = "COL_2")
|
||||
private String col2;
|
||||
|
||||
@Schema(description = "COL_3")
|
||||
private String col3;
|
||||
|
||||
@Schema(description = "COL_4")
|
||||
private String col4;
|
||||
|
||||
@Schema(description = "COL_5")
|
||||
private String col5;
|
||||
|
||||
@Schema(description = "COL_6")
|
||||
private String col6;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,423 @@
|
||||
package com.zt.plat.module.template.controller.admin.virtualizedtable.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 虚拟表格测试 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DemoVirtualizedTableRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4009")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "COL_1")
|
||||
@ExcelProperty("COL_1")
|
||||
private String col1;
|
||||
|
||||
@Schema(description = "COL_2")
|
||||
@ExcelProperty("COL_2")
|
||||
private String col2;
|
||||
|
||||
@Schema(description = "COL_3")
|
||||
@ExcelProperty("COL_3")
|
||||
private String col3;
|
||||
|
||||
@Schema(description = "COL_4")
|
||||
@ExcelProperty("COL_4")
|
||||
private String col4;
|
||||
|
||||
@Schema(description = "COL_5")
|
||||
@ExcelProperty("COL_5")
|
||||
private String col5;
|
||||
|
||||
@Schema(description = "COL_6")
|
||||
@ExcelProperty("COL_6")
|
||||
private String col6;
|
||||
|
||||
@Schema(description = "COL_7")
|
||||
@ExcelProperty("COL_7")
|
||||
private String col7;
|
||||
|
||||
@Schema(description = "COL_8")
|
||||
@ExcelProperty("COL_8")
|
||||
private String col8;
|
||||
|
||||
@Schema(description = "COL_9")
|
||||
@ExcelProperty("COL_9")
|
||||
private String col9;
|
||||
|
||||
@Schema(description = "COL_10")
|
||||
@ExcelProperty("COL_10")
|
||||
private String col10;
|
||||
|
||||
@Schema(description = "COL_11")
|
||||
@ExcelProperty("COL_11")
|
||||
private String col11;
|
||||
|
||||
@Schema(description = "COL_12")
|
||||
@ExcelProperty("COL_12")
|
||||
private String col12;
|
||||
|
||||
@Schema(description = "COL_13")
|
||||
@ExcelProperty("COL_13")
|
||||
private String col13;
|
||||
|
||||
@Schema(description = "COL_14")
|
||||
@ExcelProperty("COL_14")
|
||||
private String col14;
|
||||
|
||||
@Schema(description = "COL_15")
|
||||
@ExcelProperty("COL_15")
|
||||
private String col15;
|
||||
|
||||
@Schema(description = "COL_16")
|
||||
@ExcelProperty("COL_16")
|
||||
private String col16;
|
||||
|
||||
@Schema(description = "COL_17")
|
||||
@ExcelProperty("COL_17")
|
||||
private String col17;
|
||||
|
||||
@Schema(description = "COL_18")
|
||||
@ExcelProperty("COL_18")
|
||||
private String col18;
|
||||
|
||||
@Schema(description = "COL_19")
|
||||
@ExcelProperty("COL_19")
|
||||
private String col19;
|
||||
|
||||
@Schema(description = "COL_20")
|
||||
@ExcelProperty("COL_20")
|
||||
private String col20;
|
||||
|
||||
@Schema(description = "COL_21")
|
||||
@ExcelProperty("COL_21")
|
||||
private String col21;
|
||||
|
||||
@Schema(description = "COL_22")
|
||||
@ExcelProperty("COL_22")
|
||||
private String col22;
|
||||
|
||||
@Schema(description = "COL_23")
|
||||
@ExcelProperty("COL_23")
|
||||
private String col23;
|
||||
|
||||
@Schema(description = "COL_24")
|
||||
@ExcelProperty("COL_24")
|
||||
private String col24;
|
||||
|
||||
@Schema(description = "COL_25")
|
||||
@ExcelProperty("COL_25")
|
||||
private String col25;
|
||||
|
||||
@Schema(description = "COL_26")
|
||||
@ExcelProperty("COL_26")
|
||||
private String col26;
|
||||
|
||||
@Schema(description = "COL_27")
|
||||
@ExcelProperty("COL_27")
|
||||
private String col27;
|
||||
|
||||
@Schema(description = "COL_28")
|
||||
@ExcelProperty("COL_28")
|
||||
private String col28;
|
||||
|
||||
@Schema(description = "COL_29")
|
||||
@ExcelProperty("COL_29")
|
||||
private String col29;
|
||||
|
||||
@Schema(description = "COL_30")
|
||||
@ExcelProperty("COL_30")
|
||||
private String col30;
|
||||
|
||||
@Schema(description = "COL_31")
|
||||
@ExcelProperty("COL_31")
|
||||
private String col31;
|
||||
|
||||
@Schema(description = "COL_32")
|
||||
@ExcelProperty("COL_32")
|
||||
private String col32;
|
||||
|
||||
@Schema(description = "COL_33")
|
||||
@ExcelProperty("COL_33")
|
||||
private String col33;
|
||||
|
||||
@Schema(description = "COL_34")
|
||||
@ExcelProperty("COL_34")
|
||||
private String col34;
|
||||
|
||||
@Schema(description = "COL_35")
|
||||
@ExcelProperty("COL_35")
|
||||
private String col35;
|
||||
|
||||
@Schema(description = "COL_36")
|
||||
@ExcelProperty("COL_36")
|
||||
private String col36;
|
||||
|
||||
@Schema(description = "COL_37")
|
||||
@ExcelProperty("COL_37")
|
||||
private String col37;
|
||||
|
||||
@Schema(description = "COL_38")
|
||||
@ExcelProperty("COL_38")
|
||||
private String col38;
|
||||
|
||||
@Schema(description = "COL_39")
|
||||
@ExcelProperty("COL_39")
|
||||
private String col39;
|
||||
|
||||
@Schema(description = "COL_40")
|
||||
@ExcelProperty("COL_40")
|
||||
private String col40;
|
||||
|
||||
@Schema(description = "COL_41")
|
||||
@ExcelProperty("COL_41")
|
||||
private String col41;
|
||||
|
||||
@Schema(description = "COL_42")
|
||||
@ExcelProperty("COL_42")
|
||||
private String col42;
|
||||
|
||||
@Schema(description = "COL_43")
|
||||
@ExcelProperty("COL_43")
|
||||
private String col43;
|
||||
|
||||
@Schema(description = "COL_44")
|
||||
@ExcelProperty("COL_44")
|
||||
private String col44;
|
||||
|
||||
@Schema(description = "COL_45")
|
||||
@ExcelProperty("COL_45")
|
||||
private String col45;
|
||||
|
||||
@Schema(description = "COL_46")
|
||||
@ExcelProperty("COL_46")
|
||||
private String col46;
|
||||
|
||||
@Schema(description = "COL_47")
|
||||
@ExcelProperty("COL_47")
|
||||
private String col47;
|
||||
|
||||
@Schema(description = "COL_48")
|
||||
@ExcelProperty("COL_48")
|
||||
private String col48;
|
||||
|
||||
@Schema(description = "COL_49")
|
||||
@ExcelProperty("COL_49")
|
||||
private String col49;
|
||||
|
||||
@Schema(description = "COL_50")
|
||||
@ExcelProperty("COL_50")
|
||||
private String col50;
|
||||
|
||||
@Schema(description = "COL_51")
|
||||
@ExcelProperty("COL_51")
|
||||
private String col51;
|
||||
|
||||
@Schema(description = "COL_52")
|
||||
@ExcelProperty("COL_52")
|
||||
private String col52;
|
||||
|
||||
@Schema(description = "COL_53")
|
||||
@ExcelProperty("COL_53")
|
||||
private String col53;
|
||||
|
||||
@Schema(description = "COL_54")
|
||||
@ExcelProperty("COL_54")
|
||||
private String col54;
|
||||
|
||||
@Schema(description = "COL_55")
|
||||
@ExcelProperty("COL_55")
|
||||
private String col55;
|
||||
|
||||
@Schema(description = "COL_56")
|
||||
@ExcelProperty("COL_56")
|
||||
private String col56;
|
||||
|
||||
@Schema(description = "COL_57")
|
||||
@ExcelProperty("COL_57")
|
||||
private String col57;
|
||||
|
||||
@Schema(description = "COL_58")
|
||||
@ExcelProperty("COL_58")
|
||||
private String col58;
|
||||
|
||||
@Schema(description = "COL_59")
|
||||
@ExcelProperty("COL_59")
|
||||
private String col59;
|
||||
|
||||
@Schema(description = "COL_60")
|
||||
@ExcelProperty("COL_60")
|
||||
private String col60;
|
||||
|
||||
@Schema(description = "COL_61")
|
||||
@ExcelProperty("COL_61")
|
||||
private String col61;
|
||||
|
||||
@Schema(description = "COL_62")
|
||||
@ExcelProperty("COL_62")
|
||||
private String col62;
|
||||
|
||||
@Schema(description = "COL_63")
|
||||
@ExcelProperty("COL_63")
|
||||
private String col63;
|
||||
|
||||
@Schema(description = "COL_64")
|
||||
@ExcelProperty("COL_64")
|
||||
private String col64;
|
||||
|
||||
@Schema(description = "COL_65")
|
||||
@ExcelProperty("COL_65")
|
||||
private String col65;
|
||||
|
||||
@Schema(description = "COL_66")
|
||||
@ExcelProperty("COL_66")
|
||||
private String col66;
|
||||
|
||||
@Schema(description = "COL_67")
|
||||
@ExcelProperty("COL_67")
|
||||
private String col67;
|
||||
|
||||
@Schema(description = "COL_68")
|
||||
@ExcelProperty("COL_68")
|
||||
private String col68;
|
||||
|
||||
@Schema(description = "COL_69")
|
||||
@ExcelProperty("COL_69")
|
||||
private String col69;
|
||||
|
||||
@Schema(description = "COL_70")
|
||||
@ExcelProperty("COL_70")
|
||||
private String col70;
|
||||
|
||||
@Schema(description = "COL_71")
|
||||
@ExcelProperty("COL_71")
|
||||
private String col71;
|
||||
|
||||
@Schema(description = "COL_72")
|
||||
@ExcelProperty("COL_72")
|
||||
private String col72;
|
||||
|
||||
@Schema(description = "COL_73")
|
||||
@ExcelProperty("COL_73")
|
||||
private String col73;
|
||||
|
||||
@Schema(description = "COL_74")
|
||||
@ExcelProperty("COL_74")
|
||||
private String col74;
|
||||
|
||||
@Schema(description = "COL_75")
|
||||
@ExcelProperty("COL_75")
|
||||
private String col75;
|
||||
|
||||
@Schema(description = "COL_76")
|
||||
@ExcelProperty("COL_76")
|
||||
private String col76;
|
||||
|
||||
@Schema(description = "COL_77")
|
||||
@ExcelProperty("COL_77")
|
||||
private String col77;
|
||||
|
||||
@Schema(description = "COL_78")
|
||||
@ExcelProperty("COL_78")
|
||||
private String col78;
|
||||
|
||||
@Schema(description = "COL_79")
|
||||
@ExcelProperty("COL_79")
|
||||
private String col79;
|
||||
|
||||
@Schema(description = "COL_80")
|
||||
@ExcelProperty("COL_80")
|
||||
private String col80;
|
||||
|
||||
@Schema(description = "COL_81")
|
||||
@ExcelProperty("COL_81")
|
||||
private String col81;
|
||||
|
||||
@Schema(description = "COL_82")
|
||||
@ExcelProperty("COL_82")
|
||||
private String col82;
|
||||
|
||||
@Schema(description = "COL_83")
|
||||
@ExcelProperty("COL_83")
|
||||
private String col83;
|
||||
|
||||
@Schema(description = "COL_84")
|
||||
@ExcelProperty("COL_84")
|
||||
private String col84;
|
||||
|
||||
@Schema(description = "COL_85")
|
||||
@ExcelProperty("COL_85")
|
||||
private String col85;
|
||||
|
||||
@Schema(description = "COL_86")
|
||||
@ExcelProperty("COL_86")
|
||||
private String col86;
|
||||
|
||||
@Schema(description = "COL_87")
|
||||
@ExcelProperty("COL_87")
|
||||
private String col87;
|
||||
|
||||
@Schema(description = "COL_88")
|
||||
@ExcelProperty("COL_88")
|
||||
private String col88;
|
||||
|
||||
@Schema(description = "COL_89")
|
||||
@ExcelProperty("COL_89")
|
||||
private String col89;
|
||||
|
||||
@Schema(description = "COL_90")
|
||||
@ExcelProperty("COL_90")
|
||||
private String col90;
|
||||
|
||||
@Schema(description = "COL_91")
|
||||
@ExcelProperty("COL_91")
|
||||
private String col91;
|
||||
|
||||
@Schema(description = "COL_92")
|
||||
@ExcelProperty("COL_92")
|
||||
private String col92;
|
||||
|
||||
@Schema(description = "COL_93")
|
||||
@ExcelProperty("COL_93")
|
||||
private String col93;
|
||||
|
||||
@Schema(description = "COL_94")
|
||||
@ExcelProperty("COL_94")
|
||||
private String col94;
|
||||
|
||||
@Schema(description = "COL_95")
|
||||
@ExcelProperty("COL_95")
|
||||
private String col95;
|
||||
|
||||
@Schema(description = "COL_96")
|
||||
@ExcelProperty("COL_96")
|
||||
private String col96;
|
||||
|
||||
@Schema(description = "COL_97")
|
||||
@ExcelProperty("COL_97")
|
||||
private String col97;
|
||||
|
||||
@Schema(description = "COL_98")
|
||||
@ExcelProperty("COL_98")
|
||||
private String col98;
|
||||
|
||||
@Schema(description = "COL_99")
|
||||
@ExcelProperty("COL_99")
|
||||
private String col99;
|
||||
|
||||
@Schema(description = "COL_100")
|
||||
@ExcelProperty("COL_100")
|
||||
private String col100;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
package com.zt.plat.module.template.controller.admin.virtualizedtable.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 虚拟表格测试新增/修改 Request VO")
|
||||
@Data
|
||||
public class DemoVirtualizedTableSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4009")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "COL_1")
|
||||
private String col1;
|
||||
|
||||
@Schema(description = "COL_2")
|
||||
private String col2;
|
||||
|
||||
@Schema(description = "COL_3")
|
||||
private String col3;
|
||||
|
||||
@Schema(description = "COL_4")
|
||||
private String col4;
|
||||
|
||||
@Schema(description = "COL_5")
|
||||
private String col5;
|
||||
|
||||
@Schema(description = "COL_6")
|
||||
private String col6;
|
||||
|
||||
@Schema(description = "COL_7")
|
||||
private String col7;
|
||||
|
||||
@Schema(description = "COL_8")
|
||||
private String col8;
|
||||
|
||||
@Schema(description = "COL_9")
|
||||
private String col9;
|
||||
|
||||
@Schema(description = "COL_10")
|
||||
private String col10;
|
||||
|
||||
@Schema(description = "COL_11")
|
||||
private String col11;
|
||||
|
||||
@Schema(description = "COL_12")
|
||||
private String col12;
|
||||
|
||||
@Schema(description = "COL_13")
|
||||
private String col13;
|
||||
|
||||
@Schema(description = "COL_14")
|
||||
private String col14;
|
||||
|
||||
@Schema(description = "COL_15")
|
||||
private String col15;
|
||||
|
||||
@Schema(description = "COL_16")
|
||||
private String col16;
|
||||
|
||||
@Schema(description = "COL_17")
|
||||
private String col17;
|
||||
|
||||
@Schema(description = "COL_18")
|
||||
private String col18;
|
||||
|
||||
@Schema(description = "COL_19")
|
||||
private String col19;
|
||||
|
||||
@Schema(description = "COL_20")
|
||||
private String col20;
|
||||
|
||||
@Schema(description = "COL_21")
|
||||
private String col21;
|
||||
|
||||
@Schema(description = "COL_22")
|
||||
private String col22;
|
||||
|
||||
@Schema(description = "COL_23")
|
||||
private String col23;
|
||||
|
||||
@Schema(description = "COL_24")
|
||||
private String col24;
|
||||
|
||||
@Schema(description = "COL_25")
|
||||
private String col25;
|
||||
|
||||
@Schema(description = "COL_26")
|
||||
private String col26;
|
||||
|
||||
@Schema(description = "COL_27")
|
||||
private String col27;
|
||||
|
||||
@Schema(description = "COL_28")
|
||||
private String col28;
|
||||
|
||||
@Schema(description = "COL_29")
|
||||
private String col29;
|
||||
|
||||
@Schema(description = "COL_30")
|
||||
private String col30;
|
||||
|
||||
@Schema(description = "COL_31")
|
||||
private String col31;
|
||||
|
||||
@Schema(description = "COL_32")
|
||||
private String col32;
|
||||
|
||||
@Schema(description = "COL_33")
|
||||
private String col33;
|
||||
|
||||
@Schema(description = "COL_34")
|
||||
private String col34;
|
||||
|
||||
@Schema(description = "COL_35")
|
||||
private String col35;
|
||||
|
||||
@Schema(description = "COL_36")
|
||||
private String col36;
|
||||
|
||||
@Schema(description = "COL_37")
|
||||
private String col37;
|
||||
|
||||
@Schema(description = "COL_38")
|
||||
private String col38;
|
||||
|
||||
@Schema(description = "COL_39")
|
||||
private String col39;
|
||||
|
||||
@Schema(description = "COL_40")
|
||||
private String col40;
|
||||
|
||||
@Schema(description = "COL_41")
|
||||
private String col41;
|
||||
|
||||
@Schema(description = "COL_42")
|
||||
private String col42;
|
||||
|
||||
@Schema(description = "COL_43")
|
||||
private String col43;
|
||||
|
||||
@Schema(description = "COL_44")
|
||||
private String col44;
|
||||
|
||||
@Schema(description = "COL_45")
|
||||
private String col45;
|
||||
|
||||
@Schema(description = "COL_46")
|
||||
private String col46;
|
||||
|
||||
@Schema(description = "COL_47")
|
||||
private String col47;
|
||||
|
||||
@Schema(description = "COL_48")
|
||||
private String col48;
|
||||
|
||||
@Schema(description = "COL_49")
|
||||
private String col49;
|
||||
|
||||
@Schema(description = "COL_50")
|
||||
private String col50;
|
||||
|
||||
@Schema(description = "COL_51")
|
||||
private String col51;
|
||||
|
||||
@Schema(description = "COL_52")
|
||||
private String col52;
|
||||
|
||||
@Schema(description = "COL_53")
|
||||
private String col53;
|
||||
|
||||
@Schema(description = "COL_54")
|
||||
private String col54;
|
||||
|
||||
@Schema(description = "COL_55")
|
||||
private String col55;
|
||||
|
||||
@Schema(description = "COL_56")
|
||||
private String col56;
|
||||
|
||||
@Schema(description = "COL_57")
|
||||
private String col57;
|
||||
|
||||
@Schema(description = "COL_58")
|
||||
private String col58;
|
||||
|
||||
@Schema(description = "COL_59")
|
||||
private String col59;
|
||||
|
||||
@Schema(description = "COL_60")
|
||||
private String col60;
|
||||
|
||||
@Schema(description = "COL_61")
|
||||
private String col61;
|
||||
|
||||
@Schema(description = "COL_62")
|
||||
private String col62;
|
||||
|
||||
@Schema(description = "COL_63")
|
||||
private String col63;
|
||||
|
||||
@Schema(description = "COL_64")
|
||||
private String col64;
|
||||
|
||||
@Schema(description = "COL_65")
|
||||
private String col65;
|
||||
|
||||
@Schema(description = "COL_66")
|
||||
private String col66;
|
||||
|
||||
@Schema(description = "COL_67")
|
||||
private String col67;
|
||||
|
||||
@Schema(description = "COL_68")
|
||||
private String col68;
|
||||
|
||||
@Schema(description = "COL_69")
|
||||
private String col69;
|
||||
|
||||
@Schema(description = "COL_70")
|
||||
private String col70;
|
||||
|
||||
@Schema(description = "COL_71")
|
||||
private String col71;
|
||||
|
||||
@Schema(description = "COL_72")
|
||||
private String col72;
|
||||
|
||||
@Schema(description = "COL_73")
|
||||
private String col73;
|
||||
|
||||
@Schema(description = "COL_74")
|
||||
private String col74;
|
||||
|
||||
@Schema(description = "COL_75")
|
||||
private String col75;
|
||||
|
||||
@Schema(description = "COL_76")
|
||||
private String col76;
|
||||
|
||||
@Schema(description = "COL_77")
|
||||
private String col77;
|
||||
|
||||
@Schema(description = "COL_78")
|
||||
private String col78;
|
||||
|
||||
@Schema(description = "COL_79")
|
||||
private String col79;
|
||||
|
||||
@Schema(description = "COL_80")
|
||||
private String col80;
|
||||
|
||||
@Schema(description = "COL_81")
|
||||
private String col81;
|
||||
|
||||
@Schema(description = "COL_82")
|
||||
private String col82;
|
||||
|
||||
@Schema(description = "COL_83")
|
||||
private String col83;
|
||||
|
||||
@Schema(description = "COL_84")
|
||||
private String col84;
|
||||
|
||||
@Schema(description = "COL_85")
|
||||
private String col85;
|
||||
|
||||
@Schema(description = "COL_86")
|
||||
private String col86;
|
||||
|
||||
@Schema(description = "COL_87")
|
||||
private String col87;
|
||||
|
||||
@Schema(description = "COL_88")
|
||||
private String col88;
|
||||
|
||||
@Schema(description = "COL_89")
|
||||
private String col89;
|
||||
|
||||
@Schema(description = "COL_90")
|
||||
private String col90;
|
||||
|
||||
@Schema(description = "COL_91")
|
||||
private String col91;
|
||||
|
||||
@Schema(description = "COL_92")
|
||||
private String col92;
|
||||
|
||||
@Schema(description = "COL_93")
|
||||
private String col93;
|
||||
|
||||
@Schema(description = "COL_94")
|
||||
private String col94;
|
||||
|
||||
@Schema(description = "COL_95")
|
||||
private String col95;
|
||||
|
||||
@Schema(description = "COL_96")
|
||||
private String col96;
|
||||
|
||||
@Schema(description = "COL_97")
|
||||
private String col97;
|
||||
|
||||
@Schema(description = "COL_98")
|
||||
private String col98;
|
||||
|
||||
@Schema(description = "COL_99")
|
||||
private String col99;
|
||||
|
||||
@Schema(description = "COL_100")
|
||||
private String col100;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.zt.plat.module.template.convert.virtualizedtable;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.template.controller.admin.virtualizedtable.vo.DemoVirtualizedTableRespVO;
|
||||
import com.zt.plat.module.template.dal.dataobject.virtualizedtable.DemoVirtualizedTableDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DemoVirtualizedTableConvert {
|
||||
DemoVirtualizedTableConvert INSTANCE = Mappers.getMapper(DemoVirtualizedTableConvert.class);
|
||||
|
||||
DemoVirtualizedTableRespVO convert(DemoVirtualizedTableDO source);
|
||||
|
||||
List<DemoVirtualizedTableRespVO> convertList(List<DemoVirtualizedTableDO> source);
|
||||
|
||||
PageResult<DemoVirtualizedTableRespVO> convert(PageResult<DemoVirtualizedTableDO> source);
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.zt.plat.module.template.dal.dataobject.contract;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
/**
|
||||
* 合同 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("demo_contract")
|
||||
@KeySequence("demo_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class DemoContractDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 合同ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
@TableField("CODE")
|
||||
private String code;
|
||||
/**
|
||||
* 合同名称
|
||||
*/
|
||||
@TableField("NAME")
|
||||
private String name;
|
||||
/**
|
||||
* 合同状态
|
||||
*/
|
||||
@TableField("STATUS")
|
||||
private Short status;
|
||||
/**
|
||||
* 流程实例ID
|
||||
*/
|
||||
@TableField("PROCESS_INSTANCE_ID")
|
||||
private Long processInstanceId;
|
||||
/**
|
||||
* 签订日期
|
||||
*/
|
||||
@TableField("SIGN_DATE")
|
||||
private LocalDateTime signDate;
|
||||
/**
|
||||
* 合同开始日期
|
||||
*/
|
||||
@TableField("START_DATE")
|
||||
private LocalDateTime startDate;
|
||||
/**
|
||||
* 合同结束日期
|
||||
*/
|
||||
@TableField("END_DATE")
|
||||
private LocalDateTime endDate;
|
||||
/**
|
||||
* 合同金额
|
||||
*/
|
||||
@TableField("AMOUNT")
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("REMARK")
|
||||
private String remark;
|
||||
/**
|
||||
* 合同文件URL
|
||||
*/
|
||||
@TableField("FILE_URL")
|
||||
private String fileUrl;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.zt.plat.module.template.dal.dataobject.example;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.tenant.core.db.TenantBaseDO;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 模板样例 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName(value = "template_example", autoResultMap = true)
|
||||
@KeySequence("template_example_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ExampleDO extends TenantBaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 字符串
|
||||
*/
|
||||
private String strTemp;
|
||||
/**
|
||||
* 整数
|
||||
*/
|
||||
private Integer intTemp;
|
||||
/**
|
||||
* 小整数
|
||||
*/
|
||||
private Short sintTemp;
|
||||
/**
|
||||
* 布尔值
|
||||
*/
|
||||
@TableField(value = "bit_temp", typeHandler = org.apache.ibatis.type.BooleanTypeHandler.class)
|
||||
private Boolean bitTemp;
|
||||
/**
|
||||
* 数值类型
|
||||
*/
|
||||
private BigDecimal decimalTemp;
|
||||
/**
|
||||
* 日期类型
|
||||
*/
|
||||
private LocalDate dateTemp;
|
||||
/**
|
||||
* 时间类型
|
||||
*/
|
||||
private LocalDateTime datetimeTemp;
|
||||
|
||||
/**
|
||||
* 多租户编号
|
||||
*/
|
||||
private Long tenantId;
|
||||
}
|
||||
@@ -0,0 +1,433 @@
|
||||
package com.zt.plat.module.template.dal.dataobject.virtualizedtable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||
import lombok.*;
|
||||
/**
|
||||
* 虚拟表格测试 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("demo_virtualized_table")
|
||||
@KeySequence("demo_virtualized_table_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class DemoVirtualizedTableDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* COL_1
|
||||
*/
|
||||
private String col1;
|
||||
/**
|
||||
* COL_2
|
||||
*/
|
||||
private String col2;
|
||||
/**
|
||||
* COL_3
|
||||
*/
|
||||
private String col3;
|
||||
/**
|
||||
* COL_4
|
||||
*/
|
||||
private String col4;
|
||||
/**
|
||||
* COL_5
|
||||
*/
|
||||
private String col5;
|
||||
/**
|
||||
* COL_6
|
||||
*/
|
||||
private String col6;
|
||||
/**
|
||||
* COL_7
|
||||
*/
|
||||
private String col7;
|
||||
/**
|
||||
* COL_8
|
||||
*/
|
||||
private String col8;
|
||||
/**
|
||||
* COL_9
|
||||
*/
|
||||
private String col9;
|
||||
/**
|
||||
* COL_10
|
||||
*/
|
||||
private String col10;
|
||||
/**
|
||||
* COL_11
|
||||
*/
|
||||
private String col11;
|
||||
/**
|
||||
* COL_12
|
||||
*/
|
||||
private String col12;
|
||||
/**
|
||||
* COL_13
|
||||
*/
|
||||
private String col13;
|
||||
/**
|
||||
* COL_14
|
||||
*/
|
||||
private String col14;
|
||||
/**
|
||||
* COL_15
|
||||
*/
|
||||
private String col15;
|
||||
/**
|
||||
* COL_16
|
||||
*/
|
||||
private String col16;
|
||||
/**
|
||||
* COL_17
|
||||
*/
|
||||
private String col17;
|
||||
/**
|
||||
* COL_18
|
||||
*/
|
||||
private String col18;
|
||||
/**
|
||||
* COL_19
|
||||
*/
|
||||
private String col19;
|
||||
/**
|
||||
* COL_20
|
||||
*/
|
||||
private String col20;
|
||||
/**
|
||||
* COL_21
|
||||
*/
|
||||
private String col21;
|
||||
/**
|
||||
* COL_22
|
||||
*/
|
||||
private String col22;
|
||||
/**
|
||||
* COL_23
|
||||
*/
|
||||
private String col23;
|
||||
/**
|
||||
* COL_24
|
||||
*/
|
||||
private String col24;
|
||||
/**
|
||||
* COL_25
|
||||
*/
|
||||
private String col25;
|
||||
/**
|
||||
* COL_26
|
||||
*/
|
||||
private String col26;
|
||||
/**
|
||||
* COL_27
|
||||
*/
|
||||
private String col27;
|
||||
/**
|
||||
* COL_28
|
||||
*/
|
||||
private String col28;
|
||||
/**
|
||||
* COL_29
|
||||
*/
|
||||
private String col29;
|
||||
/**
|
||||
* COL_30
|
||||
*/
|
||||
private String col30;
|
||||
/**
|
||||
* COL_31
|
||||
*/
|
||||
private String col31;
|
||||
/**
|
||||
* COL_32
|
||||
*/
|
||||
private String col32;
|
||||
/**
|
||||
* COL_33
|
||||
*/
|
||||
private String col33;
|
||||
/**
|
||||
* COL_34
|
||||
*/
|
||||
private String col34;
|
||||
/**
|
||||
* COL_35
|
||||
*/
|
||||
private String col35;
|
||||
/**
|
||||
* COL_36
|
||||
*/
|
||||
private String col36;
|
||||
/**
|
||||
* COL_37
|
||||
*/
|
||||
private String col37;
|
||||
/**
|
||||
* COL_38
|
||||
*/
|
||||
private String col38;
|
||||
/**
|
||||
* COL_39
|
||||
*/
|
||||
private String col39;
|
||||
/**
|
||||
* COL_40
|
||||
*/
|
||||
private String col40;
|
||||
/**
|
||||
* COL_41
|
||||
*/
|
||||
private String col41;
|
||||
/**
|
||||
* COL_42
|
||||
*/
|
||||
private String col42;
|
||||
/**
|
||||
* COL_43
|
||||
*/
|
||||
private String col43;
|
||||
/**
|
||||
* COL_44
|
||||
*/
|
||||
private String col44;
|
||||
/**
|
||||
* COL_45
|
||||
*/
|
||||
private String col45;
|
||||
/**
|
||||
* COL_46
|
||||
*/
|
||||
private String col46;
|
||||
/**
|
||||
* COL_47
|
||||
*/
|
||||
private String col47;
|
||||
/**
|
||||
* COL_48
|
||||
*/
|
||||
private String col48;
|
||||
/**
|
||||
* COL_49
|
||||
*/
|
||||
private String col49;
|
||||
/**
|
||||
* COL_50
|
||||
*/
|
||||
private String col50;
|
||||
/**
|
||||
* COL_51
|
||||
*/
|
||||
private String col51;
|
||||
/**
|
||||
* COL_52
|
||||
*/
|
||||
private String col52;
|
||||
/**
|
||||
* COL_53
|
||||
*/
|
||||
private String col53;
|
||||
/**
|
||||
* COL_54
|
||||
*/
|
||||
private String col54;
|
||||
/**
|
||||
* COL_55
|
||||
*/
|
||||
private String col55;
|
||||
/**
|
||||
* COL_56
|
||||
*/
|
||||
private String col56;
|
||||
/**
|
||||
* COL_57
|
||||
*/
|
||||
private String col57;
|
||||
/**
|
||||
* COL_58
|
||||
*/
|
||||
private String col58;
|
||||
/**
|
||||
* COL_59
|
||||
*/
|
||||
private String col59;
|
||||
/**
|
||||
* COL_60
|
||||
*/
|
||||
private String col60;
|
||||
/**
|
||||
* COL_61
|
||||
*/
|
||||
private String col61;
|
||||
/**
|
||||
* COL_62
|
||||
*/
|
||||
private String col62;
|
||||
/**
|
||||
* COL_63
|
||||
*/
|
||||
private String col63;
|
||||
/**
|
||||
* COL_64
|
||||
*/
|
||||
private String col64;
|
||||
/**
|
||||
* COL_65
|
||||
*/
|
||||
private String col65;
|
||||
/**
|
||||
* COL_66
|
||||
*/
|
||||
private String col66;
|
||||
/**
|
||||
* COL_67
|
||||
*/
|
||||
private String col67;
|
||||
/**
|
||||
* COL_68
|
||||
*/
|
||||
private String col68;
|
||||
/**
|
||||
* COL_69
|
||||
*/
|
||||
private String col69;
|
||||
/**
|
||||
* COL_70
|
||||
*/
|
||||
private String col70;
|
||||
/**
|
||||
* COL_71
|
||||
*/
|
||||
private String col71;
|
||||
/**
|
||||
* COL_72
|
||||
*/
|
||||
private String col72;
|
||||
/**
|
||||
* COL_73
|
||||
*/
|
||||
private String col73;
|
||||
/**
|
||||
* COL_74
|
||||
*/
|
||||
private String col74;
|
||||
/**
|
||||
* COL_75
|
||||
*/
|
||||
private String col75;
|
||||
/**
|
||||
* COL_76
|
||||
*/
|
||||
private String col76;
|
||||
/**
|
||||
* COL_77
|
||||
*/
|
||||
private String col77;
|
||||
/**
|
||||
* COL_78
|
||||
*/
|
||||
private String col78;
|
||||
/**
|
||||
* COL_79
|
||||
*/
|
||||
private String col79;
|
||||
/**
|
||||
* COL_80
|
||||
*/
|
||||
private String col80;
|
||||
/**
|
||||
* COL_81
|
||||
*/
|
||||
private String col81;
|
||||
/**
|
||||
* COL_82
|
||||
*/
|
||||
private String col82;
|
||||
/**
|
||||
* COL_83
|
||||
*/
|
||||
private String col83;
|
||||
/**
|
||||
* COL_84
|
||||
*/
|
||||
private String col84;
|
||||
/**
|
||||
* COL_85
|
||||
*/
|
||||
private String col85;
|
||||
/**
|
||||
* COL_86
|
||||
*/
|
||||
private String col86;
|
||||
/**
|
||||
* COL_87
|
||||
*/
|
||||
private String col87;
|
||||
/**
|
||||
* COL_88
|
||||
*/
|
||||
private String col88;
|
||||
/**
|
||||
* COL_89
|
||||
*/
|
||||
private String col89;
|
||||
/**
|
||||
* COL_90
|
||||
*/
|
||||
private String col90;
|
||||
/**
|
||||
* COL_91
|
||||
*/
|
||||
private String col91;
|
||||
/**
|
||||
* COL_92
|
||||
*/
|
||||
private String col92;
|
||||
/**
|
||||
* COL_93
|
||||
*/
|
||||
private String col93;
|
||||
/**
|
||||
* COL_94
|
||||
*/
|
||||
private String col94;
|
||||
/**
|
||||
* COL_95
|
||||
*/
|
||||
private String col95;
|
||||
/**
|
||||
* COL_96
|
||||
*/
|
||||
private String col96;
|
||||
/**
|
||||
* COL_97
|
||||
*/
|
||||
private String col97;
|
||||
/**
|
||||
* COL_98
|
||||
*/
|
||||
private String col98;
|
||||
/**
|
||||
* COL_99
|
||||
*/
|
||||
private String col99;
|
||||
/**
|
||||
* COL_100
|
||||
*/
|
||||
private String col100;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.zt.plat.module.template.dal.mysql.contract;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.template.controller.admin.contract.vo.DemoContractPageReqVO;
|
||||
import com.zt.plat.module.template.dal.dataobject.contract.DemoContractDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 合同 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface DemoContractMapper extends BaseMapperX<DemoContractDO> {
|
||||
|
||||
default PageResult<DemoContractDO> selectPage(DemoContractPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DemoContractDO>()
|
||||
.eqIfPresent(DemoContractDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(DemoContractDO::getName, reqVO.getName())
|
||||
.eqIfPresent(DemoContractDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(DemoContractDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||
.betweenIfPresent(DemoContractDO::getSignDate, reqVO.getSignDate())
|
||||
.betweenIfPresent(DemoContractDO::getStartDate, reqVO.getStartDate())
|
||||
.betweenIfPresent(DemoContractDO::getEndDate, reqVO.getEndDate())
|
||||
.eqIfPresent(DemoContractDO::getAmount, reqVO.getAmount())
|
||||
.eqIfPresent(DemoContractDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(DemoContractDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(DemoContractDO::getPostId, reqVO.getPostId())
|
||||
.orderByDesc(DemoContractDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.template.dal.mysql.example;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.template.controller.admin.example.vo.ExamplePageReqVO;
|
||||
import com.zt.plat.module.template.dal.dataobject.example.ExampleDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 模板样例 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExampleMapper extends BaseMapperX<ExampleDO> {
|
||||
|
||||
default PageResult<ExampleDO> selectPage(ExamplePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ExampleDO>()
|
||||
.likeIfPresent(ExampleDO::getStrTemp, reqVO.getStrTemp())
|
||||
.eqIfPresent(ExampleDO::getIntTemp, reqVO.getIntTemp())
|
||||
.eqIfPresent(ExampleDO::getSintTemp, reqVO.getSintTemp())
|
||||
.eqIfPresent(ExampleDO::getBitTemp, reqVO.getBitTemp())
|
||||
.eqIfPresent(ExampleDO::getDecimalTemp, reqVO.getDecimalTemp())
|
||||
.eqIfPresent(ExampleDO::getDateTemp, reqVO.getDateTemp())
|
||||
.eqIfPresent(ExampleDO::getDatetimeTemp, reqVO.getDatetimeTemp())
|
||||
.betweenIfPresent(ExampleDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ExampleDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.zt.plat.module.template.dal.mysql.virtualizedtable;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.template.controller.admin.virtualizedtable.vo.DemoVirtualizedTablePageReqVO;
|
||||
import com.zt.plat.module.template.dal.dataobject.virtualizedtable.DemoVirtualizedTableDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 虚拟表格测试 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface DemoVirtualizedTableMapper extends BaseMapperX<DemoVirtualizedTableDO> {
|
||||
|
||||
default PageResult<DemoVirtualizedTableDO> selectPage(DemoVirtualizedTablePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DemoVirtualizedTableDO>()
|
||||
.eqIfPresent(DemoVirtualizedTableDO::getCol1, reqVO.getCol1())
|
||||
.eqIfPresent(DemoVirtualizedTableDO::getCol2, reqVO.getCol2())
|
||||
.eqIfPresent(DemoVirtualizedTableDO::getCol3, reqVO.getCol3())
|
||||
.eqIfPresent(DemoVirtualizedTableDO::getCol4, reqVO.getCol4())
|
||||
.eqIfPresent(DemoVirtualizedTableDO::getCol5, reqVO.getCol5())
|
||||
.eqIfPresent(DemoVirtualizedTableDO::getCol6, reqVO.getCol6())
|
||||
.betweenIfPresent(DemoVirtualizedTableDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DemoVirtualizedTableDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.zt.plat.module.template.framework.rpc.config;
|
||||
|
||||
import com.zt.plat.module.infra.api.config.ConfigApi;
|
||||
import com.zt.plat.module.infra.api.file.FileApi;
|
||||
import com.zt.plat.module.infra.api.websocket.WebSocketSenderApi;
|
||||
import com.zt.plat.module.system.api.dept.DeptApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(value = "templateRpcConfiguration", proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {FileApi.class, WebSocketSenderApi.class, ConfigApi.class, DeptApi.class})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.zt.plat.module.template.framework.security.config;
|
||||
|
||||
import com.zt.plat.framework.security.config.AuthorizeRequestsCustomizer;
|
||||
import com.zt.plat.module.infra.enums.ApiConstants;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
|
||||
|
||||
|
||||
/**
|
||||
* Template 模块的 Security 配置
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public class SecurityConfiguration {
|
||||
|
||||
@Bean
|
||||
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
||||
return new AuthorizeRequestsCustomizer() {
|
||||
|
||||
@Override
|
||||
public void customize(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) {
|
||||
// Swagger 接口文档
|
||||
registry.requestMatchers("/v3/api-docs/**").permitAll()
|
||||
.requestMatchers("/webjars/**").permitAll()
|
||||
.requestMatchers("/swagger-ui").permitAll()
|
||||
.requestMatchers("/swagger-ui/**").permitAll();
|
||||
// Druid 监控
|
||||
registry.requestMatchers("/druid/**").permitAll();
|
||||
// Spring Boot Actuator 的安全配置
|
||||
registry.requestMatchers("/actuator").permitAll()
|
||||
.requestMatchers("/actuator/**").permitAll();
|
||||
// RPC 服务的安全配置
|
||||
registry.requestMatchers(ApiConstants.PREFIX + "/**").permitAll();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zt.plat.module.template.service.contract;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.template.controller.admin.contract.vo.*;
|
||||
import com.zt.plat.module.template.dal.dataobject.contract.DemoContractDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 合同 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface DemoContractService {
|
||||
|
||||
/**
|
||||
* 创建合同
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
DemoContractRespVO createDemoContract(@Valid DemoContractSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新合同
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDemoContract(@Valid DemoContractSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除合同
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDemoContract(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除合同
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDemoContractListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得合同
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 合同
|
||||
*/
|
||||
DemoContractDO getDemoContract(Long id);
|
||||
|
||||
/**
|
||||
* 获得合同分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 合同分页
|
||||
*/
|
||||
PageResult<DemoContractDO> getDemoContractPage(DemoContractPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.template.service.contract;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.module.template.controller.admin.contract.vo.*;
|
||||
import com.zt.plat.module.template.dal.dataobject.contract.DemoContractDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.template.dal.mysql.contract.DemoContractMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.template.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 合同 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DemoContractServiceImpl implements DemoContractService {
|
||||
|
||||
@Resource
|
||||
private DemoContractMapper demoContractMapper;
|
||||
|
||||
@Override
|
||||
public DemoContractRespVO createDemoContract(DemoContractSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DemoContractDO demoContract = BeanUtils.toBean(createReqVO, DemoContractDO.class);
|
||||
demoContractMapper.insert(demoContract);
|
||||
// 返回
|
||||
return BeanUtils.toBean(demoContract, DemoContractRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDemoContract(DemoContractSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDemoContractExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DemoContractDO updateObj = BeanUtils.toBean(updateReqVO, DemoContractDO.class);
|
||||
demoContractMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDemoContract(Long id) {
|
||||
// 校验存在
|
||||
validateDemoContractExists(id);
|
||||
// 删除
|
||||
demoContractMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDemoContractListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateDemoContractExists(ids);
|
||||
// 删除
|
||||
demoContractMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateDemoContractExists(List<Long> ids) {
|
||||
List<DemoContractDO> list = demoContractMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(DEMO_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateDemoContractExists(Long id) {
|
||||
if (demoContractMapper.selectById(id) == null) {
|
||||
throw exception(DEMO_CONTRACT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DemoContractDO getDemoContract(Long id) {
|
||||
return demoContractMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DemoContractDO> getDemoContractPage(DemoContractPageReqVO pageReqVO) {
|
||||
return demoContractMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.zt.plat.module.template.service.example;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.template.controller.admin.example.vo.ExamplePageReqVO;
|
||||
import com.zt.plat.module.template.controller.admin.example.vo.ExampleSaveReqVO;
|
||||
import com.zt.plat.module.template.dal.dataobject.example.ExampleDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模板样例 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface ExampleService {
|
||||
|
||||
/**
|
||||
* 创建模板样例
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createExample(@Valid ExampleSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新模板样例
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateExample(@Valid ExampleSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除模板样例
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteExample(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除模板样例
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteExampleListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得模板样例
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 模板样例
|
||||
*/
|
||||
ExampleDO getExample(Long id);
|
||||
|
||||
/**
|
||||
* 获得模板样例分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 模板样例分页
|
||||
*/
|
||||
PageResult<ExampleDO> getExamplePage(ExamplePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.zt.plat.module.template.service.example;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.template.controller.admin.example.vo.ExamplePageReqVO;
|
||||
import com.zt.plat.module.template.controller.admin.example.vo.ExampleSaveReqVO;
|
||||
import com.zt.plat.module.template.dal.dataobject.example.ExampleDO;
|
||||
import com.zt.plat.module.template.dal.mysql.example.ExampleMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.template.enums.ErrorCodeConstants.EXAMPLE_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 模板样例 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ExampleServiceImpl implements ExampleService {
|
||||
|
||||
@Resource
|
||||
private ExampleMapper exampleMapper;
|
||||
|
||||
@Override
|
||||
public Long createExample(ExampleSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ExampleDO example = BeanUtils.toBean(createReqVO, ExampleDO.class);
|
||||
exampleMapper.insert(example);
|
||||
// 返回
|
||||
return example.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExample(ExampleSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateExampleExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ExampleDO updateObj = BeanUtils.toBean(updateReqVO, ExampleDO.class);
|
||||
exampleMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteExample(Long id) {
|
||||
// 校验存在
|
||||
validateExampleExists(id);
|
||||
// 删除
|
||||
exampleMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteExampleListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateExampleExists(ids);
|
||||
// 删除
|
||||
exampleMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateExampleExists(List<Long> ids) {
|
||||
List<ExampleDO> list = exampleMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(EXAMPLE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateExampleExists(Long id) {
|
||||
if (exampleMapper.selectById(id) == null) {
|
||||
throw exception(EXAMPLE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExampleDO getExample(Long id) {
|
||||
return exampleMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ExampleDO> getExamplePage(ExamplePageReqVO pageReqVO) {
|
||||
return exampleMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.template.service.virtualizedtable;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.template.controller.admin.virtualizedtable.vo.DemoVirtualizedTablePageReqVO;
|
||||
import com.zt.plat.module.template.controller.admin.virtualizedtable.vo.DemoVirtualizedTableRespVO;
|
||||
import com.zt.plat.module.template.controller.admin.virtualizedtable.vo.DemoVirtualizedTableSaveReqVO;
|
||||
import com.zt.plat.module.template.dal.dataobject.virtualizedtable.DemoVirtualizedTableDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 虚拟表格测试 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface DemoVirtualizedTableService {
|
||||
|
||||
/**
|
||||
* 创建虚拟表格测试
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
DemoVirtualizedTableRespVO createDemoVirtualizedTable(@Valid DemoVirtualizedTableSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新虚拟表格测试
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDemoVirtualizedTable(@Valid DemoVirtualizedTableSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除虚拟表格测试
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDemoVirtualizedTable(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除虚拟表格测试
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDemoVirtualizedTableListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得虚拟表格测试
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 虚拟表格测试
|
||||
*/
|
||||
DemoVirtualizedTableDO getDemoVirtualizedTable(Long id);
|
||||
|
||||
/**
|
||||
* 获得虚拟表格测试分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 虚拟表格测试分页
|
||||
*/
|
||||
PageResult<DemoVirtualizedTableDO> getDemoVirtualizedTablePage(DemoVirtualizedTablePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.zt.plat.module.template.service.virtualizedtable;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.template.controller.admin.virtualizedtable.vo.DemoVirtualizedTablePageReqVO;
|
||||
import com.zt.plat.module.template.controller.admin.virtualizedtable.vo.DemoVirtualizedTableRespVO;
|
||||
import com.zt.plat.module.template.controller.admin.virtualizedtable.vo.DemoVirtualizedTableSaveReqVO;
|
||||
import com.zt.plat.module.template.dal.dataobject.virtualizedtable.DemoVirtualizedTableDO;
|
||||
import com.zt.plat.module.template.dal.mysql.virtualizedtable.DemoVirtualizedTableMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.template.enums.ErrorCodeConstants.DEMO_VIRTUALIZED_TABLE_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 虚拟表格测试 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DemoVirtualizedTableServiceImpl implements DemoVirtualizedTableService {
|
||||
|
||||
@Resource
|
||||
private DemoVirtualizedTableMapper demoVirtualizedTableMapper;
|
||||
|
||||
@Override
|
||||
public DemoVirtualizedTableRespVO createDemoVirtualizedTable(DemoVirtualizedTableSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DemoVirtualizedTableDO demoVirtualizedTable = BeanUtils.toBean(createReqVO, DemoVirtualizedTableDO.class);
|
||||
demoVirtualizedTableMapper.insert(demoVirtualizedTable);
|
||||
// 返回
|
||||
return BeanUtils.toBean(demoVirtualizedTable, DemoVirtualizedTableRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDemoVirtualizedTable(DemoVirtualizedTableSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDemoVirtualizedTableExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DemoVirtualizedTableDO updateObj = BeanUtils.toBean(updateReqVO, DemoVirtualizedTableDO.class);
|
||||
demoVirtualizedTableMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDemoVirtualizedTable(Long id) {
|
||||
// 校验存在
|
||||
validateDemoVirtualizedTableExists(id);
|
||||
// 删除
|
||||
demoVirtualizedTableMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDemoVirtualizedTableListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateDemoVirtualizedTableExists(ids);
|
||||
// 删除
|
||||
demoVirtualizedTableMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateDemoVirtualizedTableExists(List<Long> ids) {
|
||||
List<DemoVirtualizedTableDO> list = demoVirtualizedTableMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(
|
||||
DEMO_VIRTUALIZED_TABLE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateDemoVirtualizedTableExists(Long id) {
|
||||
if (demoVirtualizedTableMapper.selectById(id) == null) {
|
||||
throw exception(DEMO_VIRTUALIZED_TABLE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DemoVirtualizedTableDO getDemoVirtualizedTable(Long id) {
|
||||
return demoVirtualizedTableMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DemoVirtualizedTableDO> getDemoVirtualizedTablePage(DemoVirtualizedTablePageReqVO pageReqVO) {
|
||||
return demoVirtualizedTableMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
--- #################### 数据库相关配置 ####################
|
||||
spring:
|
||||
# 数据源配置项
|
||||
autoconfigure:
|
||||
exclude:
|
||||
datasource:
|
||||
druid: # Druid 【监控】相关的全局配置
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
allow: # 设置白名单,不填则允许所有访问
|
||||
url-pattern: /druid/*
|
||||
login-username: # 控制台管理用户名和密码
|
||||
login-password:
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
log-slow-sql: true # 慢 SQL 记录
|
||||
slow-sql-millis: 100
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
dynamic: # 多数据源配置
|
||||
druid: # Druid 【连接池】相关的全局配置
|
||||
initial-size: 5 # 初始连接数
|
||||
min-idle: 10 # 最小连接池数量
|
||||
max-active: 20 # 最大连接池数量
|
||||
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
|
||||
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
|
||||
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
|
||||
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
|
||||
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
redis:
|
||||
host: nacos-redis # 地址
|
||||
port: 6379 # 端口
|
||||
database: 1 # 数据库索引
|
||||
# password: 123456 # 密码,建议生产环境开启
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
||||
rocketmq:
|
||||
name-server: 172.16.46.63:30876 # RocketMQ Namesrv
|
||||
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: http://172.16.46.63:30082/xxl-job-admin # 调度中心部署跟地址
|
||||
|
||||
--- #################### 服务保障相关配置 ####################
|
||||
|
||||
# Lock4j 配置项
|
||||
lock4j:
|
||||
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
||||
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
||||
|
||||
--- #################### 监控相关配置 ####################
|
||||
|
||||
# Actuator 监控端点的配置项
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||
exposure:
|
||||
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||
|
||||
# Spring Boot Admin 配置项
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
# Spring Boot Admin Client 客户端的相关配置
|
||||
client:
|
||||
instance:
|
||||
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
|
||||
# Spring Boot Admin Server 服务端的相关配置
|
||||
context-path: /admin # 配置 Spring
|
||||
|
||||
# 日志文件配置
|
||||
logging:
|
||||
file:
|
||||
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
|
||||
|
||||
--- #################### 微信公众号、小程序相关配置 ####################
|
||||
wx:
|
||||
mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
|
||||
# app-id: wx041349c6f39b268b
|
||||
# secret: 5abee519483bc9f8cb37ce280e814bd0
|
||||
app-id: wx5b23ba7a5589ecbb # 测试号
|
||||
secret: 2a7b3b20c537e52e74afd395eb85f61f
|
||||
# 存储配置,解决 AccessToken 的跨节点的共享
|
||||
config-storage:
|
||||
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
|
||||
key-prefix: wx # Redis Key 的前缀
|
||||
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
|
||||
miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档
|
||||
# appid: wx62056c0d5e8db250
|
||||
# secret: 333ae72f41552af1e998fe1f54e1584a
|
||||
appid: wx63c280fe3248a3e7 # wenhualian的接口测试号
|
||||
secret: 6f270509224a7ae1296bbf1c8cb97aed
|
||||
config-storage:
|
||||
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
|
||||
key-prefix: wa # Redis Key 的前缀
|
||||
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
|
||||
|
||||
justauth:
|
||||
enabled: true
|
||||
type:
|
||||
DINGTALK: # 钉钉
|
||||
client-id: dingvrnreaje3yqvzhxg
|
||||
client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI
|
||||
ignore-check-redirect-uri: true
|
||||
WECHAT_ENTERPRISE: # 企业微信
|
||||
client-id: wwd411c69a39ad2e54
|
||||
client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
|
||||
agent-id: 1000004
|
||||
ignore-check-redirect-uri: true
|
||||
# noinspection SpringBootApplicationYaml
|
||||
WECHAT_MINI_PROGRAM: # 微信小程序
|
||||
client-id: ${wx.miniapp.appid}
|
||||
client-secret: ${wx.miniapp.secret}
|
||||
ignore-check-redirect-uri: true
|
||||
ignore-check-state: true # 微信小程序,不会使用到 state,所以不进行校验
|
||||
WECHAT_MP: # 微信公众号
|
||||
client-id: ${wx.mp.app-id}
|
||||
client-secret: ${wx.mp.secret}
|
||||
ignore-check-redirect-uri: true
|
||||
cache:
|
||||
type: REDIS
|
||||
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
|
||||
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
||||
@@ -0,0 +1,116 @@
|
||||
--- #################### 数据库相关配置 ####################
|
||||
spring:
|
||||
# 数据源配置项
|
||||
autoconfigure:
|
||||
# noinspection SpringBootApplicationYaml
|
||||
exclude:
|
||||
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
||||
datasource:
|
||||
druid: # Druid 【监控】相关的全局配置
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
allow: # 设置白名单,不填则允许所有访问
|
||||
url-pattern: /druid/*
|
||||
login-username: # 控制台管理用户名和密码
|
||||
login-password:
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
log-slow-sql: true # 慢 SQL 记录
|
||||
slow-sql-millis: 100
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
dynamic: # 多数据源配置
|
||||
druid: # Druid 【连接池】相关的全局配置
|
||||
initial-size: 1 # 初始连接数
|
||||
min-idle: 1 # 最小连接池数量
|
||||
max-active: 20 # 最大连接池数量
|
||||
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
|
||||
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
|
||||
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
|
||||
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
|
||||
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||||
username: SYSDBA
|
||||
password: pgbsci6ddJ6Sqj@e
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
redis:
|
||||
host: 172.16.46.63 # 地址
|
||||
port: 30379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
# password: 123456 # 密码,建议生产环境开启
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: http://172.16.46.63:30082/xxl-job-admin # 调度中心部署跟地址
|
||||
|
||||
--- #################### 服务保障相关配置 ####################
|
||||
|
||||
# Lock4j 配置项
|
||||
lock4j:
|
||||
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
||||
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
||||
|
||||
--- #################### 监控相关配置 ####################
|
||||
|
||||
# Actuator 监控端点的配置项
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||
exposure:
|
||||
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||
|
||||
# Spring Boot Admin 配置项
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
# Spring Boot Admin Client 客户端的相关配置
|
||||
client:
|
||||
instance:
|
||||
service-host-type: IP # 注册实例时,优先使用 IP [IP, HOST_NAME, CANONICAL_HOST_NAME]
|
||||
|
||||
# 日志文件配置
|
||||
logging:
|
||||
level:
|
||||
# 配置自己写的 MyBatis Mapper 打印日志
|
||||
com.zt.plat.module.demo.dal.mysql: debug
|
||||
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示
|
||||
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
# 芋道配置项,设置当前项目所有自定义的配置
|
||||
zt:
|
||||
env: # 多环境的配置项
|
||||
tag: ${HOSTNAME}
|
||||
security:
|
||||
mock-enable: true
|
||||
access-log: # 访问日志的配置项
|
||||
enable: true
|
||||
@@ -0,0 +1,133 @@
|
||||
spring:
|
||||
application:
|
||||
name: template-server
|
||||
|
||||
profiles:
|
||||
active: ${env.name}
|
||||
#统一nacos配置,使用 profile 管理
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: ${config.server-addr} # Nacos 服务器地址
|
||||
username: ${config.username} # Nacos 账号
|
||||
password: ${config.password} # Nacos 密码
|
||||
discovery: # 【配置中心】配置项
|
||||
namespace: ${config.namespace} # 命名空间。这里使用 maven Profile 资源过滤进行动态替换
|
||||
group: ${config.group} # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||
config: # 【注册中心】配置项
|
||||
namespace: ${config.namespace} # 命名空间。这里使用 maven Profile 资源过滤进行动态替换
|
||||
group: ${config.group} # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
main:
|
||||
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
||||
allow-bean-definition-overriding: true # 允许 Bean 覆盖,例如说 Feign 等会存在重复定义的服务
|
||||
|
||||
config:
|
||||
import:
|
||||
- optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置
|
||||
- optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置
|
||||
|
||||
# Servlet 配置
|
||||
servlet:
|
||||
# 文件上传相关配置项
|
||||
multipart:
|
||||
max-file-size: 16MB # 单个文件大小
|
||||
max-request-size: 32MB # 设置总上传的文件大小
|
||||
|
||||
# Jackson 配置项
|
||||
jackson:
|
||||
serialization:
|
||||
write-dates-as-timestamps: true # 设置 LocalDateTime 的格式,使用时间戳
|
||||
write-date-timestamps-as-nanoseconds: false # 设置不使用 nanoseconds 的格式。例如说 1611460870.401,而是直接 1611460870401
|
||||
write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳
|
||||
fail-on-empty-beans: false # 允许序列化无属性的 Bean
|
||||
time-zone: Asia/Shanghai
|
||||
|
||||
# Cache 配置项
|
||||
cache:
|
||||
type: REDIS
|
||||
redis:
|
||||
time-to-live: 1h # 设置过期时间为 1 小时
|
||||
|
||||
server:
|
||||
port: 48100
|
||||
|
||||
logging:
|
||||
file:
|
||||
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
|
||||
|
||||
--- #################### 接口文档配置 ####################
|
||||
|
||||
springdoc:
|
||||
api-docs:
|
||||
enabled: true # 1. 是否开启 Swagger 接文档的元数据
|
||||
path: /v3/api-docs
|
||||
swagger-ui:
|
||||
enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面
|
||||
path: /swagger-ui.html
|
||||
default-flat-param-object: true # 参见 https://doc.xiaominfo.com/docs/faq/v4/knife4j-parameterobject-flat-param 文档
|
||||
|
||||
knife4j:
|
||||
enable: true # 2.2 是否开启 Swagger 文档的 Knife4j UI 界面
|
||||
setting:
|
||||
language: zh_cn
|
||||
|
||||
# MyBatis Plus 的配置项
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
||||
# id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
|
||||
# id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
|
||||
# id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
|
||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||
banner: false # 关闭控制台的 Banner 打印
|
||||
type-aliases-package: ${zt.info.base-package}.module.*.dal.dataobject
|
||||
encryptor:
|
||||
password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成
|
||||
|
||||
mybatis-plus-join:
|
||||
banner: false # 关闭控制台的 Banner 打印
|
||||
|
||||
# VO 转换(数据翻译)相关
|
||||
easy-trans:
|
||||
is-enable-global: false # 启用全局翻译(拦截所有 SpringMVC ResponseBody 进行自动翻译 )。如果对于性能要求很高可关闭此配置,或通过 @IgnoreTrans 忽略某个接口
|
||||
|
||||
--- #################### RPC 远程调用相关配置 ####################
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
|
||||
xxl:
|
||||
job:
|
||||
executor:
|
||||
appname: ${spring.application.name} # 执行器 AppName
|
||||
logpath: ${user.home}/logs/xxl-job/${spring.application.name} # 执行器运行日志文件存储磁盘路径
|
||||
accessToken: default_token # 执行器通讯TOKEN
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
zt:
|
||||
info:
|
||||
version: 1.0.0
|
||||
base-package: com.zt.plat.module.template
|
||||
web:
|
||||
admin-ui:
|
||||
url: http://dashboard.zt.iocoder.cn # Admin 管理后台 UI 的地址
|
||||
xss:
|
||||
enable: false
|
||||
exclude-urls: # 如下两个 url,仅仅是为了演示,去掉配置也没关系
|
||||
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
|
||||
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
|
||||
swagger:
|
||||
title: 管理后台
|
||||
description: 提供管理员管理的所有功能
|
||||
version: ${zt.info.version}
|
||||
tenant: # 多租户相关配置项
|
||||
enable: true
|
||||
|
||||
debug: false
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.template.dal.mysql.contract.DemoContractMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.template.dal.mysql.example.ExampleMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.template.dal.mysql.virtualizedtable.DemoVirtualizedTableMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,55 @@
|
||||
-- 菜单 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status, component_name
|
||||
)
|
||||
VALUES (
|
||||
'模板样例管理', '', 2, 0, 5013,
|
||||
'example', '', 'template/example/index', 0, 'Example'
|
||||
);
|
||||
|
||||
-- 按钮父菜单ID
|
||||
-- 暂时只支持 MySQL。如果你是 Oracle、PostgreSQL、SQLServer 的话,需要手动修改 @parentId 的部分的代码
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'模板样例查询', 'template:example:query', 3, 1, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'模板样例创建', 'template:example:create', 3, 2, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'模板样例更新', 'template:example:update', 3, 3, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'模板样例删除', 'template:example:delete', 3, 4, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
INSERT INTO system_menu(
|
||||
name, permission, type, sort, parent_id,
|
||||
path, icon, component, status
|
||||
)
|
||||
VALUES (
|
||||
'模板样例导出', 'template:example:export', 3, 5, @parentId,
|
||||
'', '', '', 0
|
||||
);
|
||||
Reference in New Issue
Block a user