Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ximai
mes
Commits
529b699c
Commit
529b699c
authored
Aug 28, 2024
by
李驰骋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码生成调整
parent
7d5744e3
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
638 additions
and
296 deletions
+638
-296
pom.xml
admin/pom.xml
+6
-0
ApiController.java
...n/java/com/ximai/web/controller/common/ApiController.java
+0
-45
Knife4jConfiguration.java
.../java/com/ximai/web/core/config/Knife4jConfiguration.java
+34
-0
SwaggerConfig.java
...rc/main/java/com/ximai/web/core/config/SwaggerConfig.java
+5
-2
application-dev.yml
admin/src/main/resources/application-dev.yml
+6
-4
application-test.yml
admin/src/main/resources/application-test.yml
+7
-5
application.yml
admin/src/main/resources/application.yml
+1
-1
MybatisPlusConfig.java
...in/java/com/ximai/framework/config/MybatisPlusConfig.java
+0
-152
SecurityConfig.java
.../main/java/com/ximai/framework/config/SecurityConfig.java
+1
-0
GenTableServiceImpl.java
...java/com/ximai/generator/service/GenTableServiceImpl.java
+28
-1
IGenTableService.java
...in/java/com/ximai/generator/service/IGenTableService.java
+8
-0
VelocityUtils.java
...src/main/java/com/ximai/generator/util/VelocityUtils.java
+25
-0
controller.java.vm
generator/src/main/resources/vm/java/controller.java.vm
+26
-13
domain.java.vm
generator/src/main/resources/vm/java/domain.java.vm
+9
-51
dto-create.java.vm
generator/src/main/resources/vm/java/dto-create.java.vm
+53
-0
dto-excelExport.java.vm
generator/src/main/resources/vm/java/dto-excelExport.java.vm
+62
-0
dto-excelImport.java.vm
generator/src/main/resources/vm/java/dto-excelImport.java.vm
+62
-0
dto-query.java.vm
generator/src/main/resources/vm/java/dto-query.java.vm
+53
-0
dto-update.java.vm
generator/src/main/resources/vm/java/dto-update.java.vm
+53
-0
mapper.java.vm
generator/src/main/resources/vm/java/mapper.java.vm
+3
-2
service.java.vm
generator/src/main/resources/vm/java/service.java.vm
+25
-5
serviceImpl.java.vm
generator/src/main/resources/vm/java/serviceImpl.java.vm
+39
-6
mapper.xml.vm
generator/src/main/resources/vm/xml/mapper.xml.vm
+12
-6
BuildUtil.java
generator/src/test/java/com/ximai/generator/BuildUtil.java
+120
-0
SapService.java
mes/src/main/java/com/ximai/mes/face/sap/SapService.java
+0
-3
No files found.
admin/pom.xml
View file @
529b699c
...
@@ -30,6 +30,12 @@
...
@@ -30,6 +30,12 @@
<artifactId>
springfox-boot-starter
</artifactId>
<artifactId>
springfox-boot-starter
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
knife4j-spring-boot-starter
</artifactId>
<version>
3.0.2
</version>
</dependency>
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
<dependency>
<dependency>
<groupId>
io.swagger
</groupId>
<groupId>
io.swagger
</groupId>
...
...
admin/src/main/java/com/ximai/web/controller/common/ApiController.java
deleted
100644 → 0
View file @
7d5744e3
package
com
.
ximai
.
web
.
controller
.
common
;
import
com.ximai.common.core.domain.AjaxResult
;
import
com.ximai.mes.od.service.IOdPurchaseOrderService
;
import
com.ximai.mes.od.vo.PurchaseOrderDto
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* @since created by hyy on 2024-01-23
*/
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping
(
"/api"
)
public
class
ApiController
{
private
final
IOdPurchaseOrderService
purchaseOrderService
;
/**
* 接收到的采购订单数据
*/
@PostMapping
(
"od/purchaseOrder/batchInsert"
)
public
AjaxResult
batchInsert
(
@RequestBody
List
<
PurchaseOrderDto
>
purchaseOrderList
)
{
log
.
info
(
"接收到的采购订单数据: [ {} ]"
,
purchaseOrderList
);
final
int
i
=
purchaseOrderService
.
batchInsert
(
purchaseOrderList
);
return
i
>
0
?
AjaxResult
.
success
()
:
AjaxResult
.
error
();
}
/**
* 接收到的采购订单数据
*/
@PostMapping
(
"od/purchaseOrder/batchSave"
)
public
AjaxResult
batchSave
(
@RequestBody
List
<
PurchaseOrderDto
>
purchaseOrderList
)
{
log
.
info
(
"接收到的采购订单数据: [ {} ]"
,
purchaseOrderList
);
final
int
i
=
purchaseOrderService
.
batchSave
(
purchaseOrderList
);
return
i
>
0
?
AjaxResult
.
success
()
:
AjaxResult
.
error
();
}
}
admin/src/main/java/com/ximai/web/core/config/Knife4jConfiguration.java
0 → 100644
View file @
529b699c
//package com.ximai.web.core.config;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import springfox.documentation.builders.ApiInfoBuilder;
//import springfox.documentation.builders.PathSelectors;
//import springfox.documentation.builders.RequestHandlerSelectors;
//import springfox.documentation.spi.DocumentationType;
//import springfox.documentation.spring.web.plugins.Docket;
//import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
//
//@Configuration
//@EnableSwagger2WebMvc
//public class Knife4jConfiguration {
// @Bean(value = "dockerBean")
// public Docket dockerBean() {
// //指定使用Swagger2规范
// Docket docket=new Docket(DocumentationType.SWAGGER_2)
// .apiInfo(new ApiInfoBuilder()
// //描述字段支持Markdown语法
// .description("# Knife4j RESTful APIs")
// .termsOfServiceUrl("https://doc.xiaominfo.com/")
// .version("1.0")
// .build())
// //分组名称
// .groupName("用户服务")
// .select()
// //这里指定Controller扫描包路径
// .apis(RequestHandlerSelectors.basePackage("com.github.xiaoymin.knife4j.controller"))
// .paths(PathSelectors.any())
// .build();
// return docket;
// }
//}
admin/src/main/java/com/ximai/web/core/config/SwaggerConfig.java
View file @
529b699c
package
com
.
ximai
.
web
.
core
.
config
;
package
com
.
ximai
.
web
.
core
.
config
;
import
com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j
;
import
com.ximai.common.config.RuoYiConfig
;
import
com.ximai.common.config.RuoYiConfig
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.models.auth.In
;
import
io.swagger.models.auth.In
;
...
@@ -15,6 +16,7 @@ import springfox.documentation.service.*;
...
@@ -15,6 +16,7 @@ import springfox.documentation.service.*;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spi.service.contexts.SecurityContext
;
import
springfox.documentation.spi.service.contexts.SecurityContext
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -24,6 +26,8 @@ import java.util.List;
...
@@ -24,6 +26,8 @@ import java.util.List;
*/
*/
@Data
@Data
@Configuration
@Configuration
@EnableSwagger2
@EnableKnife4j
public
class
SwaggerConfig
{
public
class
SwaggerConfig
{
/**
/**
* 系统基础配置
* 系统基础配置
...
@@ -64,8 +68,7 @@ public class SwaggerConfig {
...
@@ -64,8 +68,7 @@ public class SwaggerConfig {
.
build
()
.
build
()
/* 设置安全模式,swagger可以设置访问token */
/* 设置安全模式,swagger可以设置访问token */
.
securitySchemes
(
securitySchemes
())
.
securitySchemes
(
securitySchemes
())
.
securityContexts
(
securityContexts
())
.
securityContexts
(
securityContexts
());
.
pathMapping
(
pathMapping
);
}
}
/**
/**
...
...
admin/src/main/resources/application-dev.yml
View file @
529b699c
...
@@ -9,7 +9,7 @@ ximai-mes:
...
@@ -9,7 +9,7 @@ ximai-mes:
# 实例演示开关
# 实例演示开关
demoEnabled
:
true
demoEnabled
:
true
# 文件路径 示例( Windows配置D:/ximai/uploadPath,Linux配置 /home/ximai/uploadPath)
# 文件路径 示例( Windows配置D:/ximai/uploadPath,Linux配置 /home/ximai/uploadPath)
profile
:
D:/source_code/j2eeworkspace/
bsn
-mes/upload
profile
:
D:/source_code/j2eeworkspace/
xiaomi
-mes/upload
#profile: /home/www/uploadPath
#profile: /home/www/uploadPath
# 获取ip地址开关
# 获取ip地址开关
addressEnabled
:
false
addressEnabled
:
false
...
@@ -42,6 +42,8 @@ logging:
...
@@ -42,6 +42,8 @@ logging:
druid
:
druid
:
sql
:
sql
:
Statement
:
debug
Statement
:
debug
file
:
name
:
ximai-mes.log
# Spring配置
# Spring配置
spring
:
spring
:
...
@@ -55,9 +57,9 @@ spring:
...
@@ -55,9 +57,9 @@ spring:
druid
:
druid
:
# 主库数据源
# 主库数据源
master
:
master
:
url
:
jdbc:mysql://
192.168.222.136:3306/xm_mes_dev
?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://
localhost:3307/mes-new
?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
admin
username
:
root
password
:
t0psunit
password
:
123456
# 从库数据源
# 从库数据源
slave
:
slave
:
# 从数据源开关/默认关闭
# 从数据源开关/默认关闭
...
...
admin/src/main/resources/application-test.yml
View file @
529b699c
...
@@ -22,8 +22,8 @@ ximai-mes:
...
@@ -22,8 +22,8 @@ ximai-mes:
# 开发环境配置
# 开发环境配置
server
:
server
:
# 服务器的HTTP端口,默认为808
0
# 服务器的HTTP端口,默认为808
1
port
:
808
0
port
:
808
8
servlet
:
servlet
:
# 应用的访问路径
# 应用的访问路径
context-path
:
/
context-path
:
/
...
@@ -46,6 +46,8 @@ logging:
...
@@ -46,6 +46,8 @@ logging:
druid
:
druid
:
sql
:
sql
:
Statement
:
debug
Statement
:
debug
file
:
name
:
ximai-mes.log
# Spring配置
# Spring配置
spring
:
spring
:
...
@@ -59,9 +61,9 @@ spring:
...
@@ -59,9 +61,9 @@ spring:
druid
:
druid
:
# 主库数据源
# 主库数据源
master
:
master
:
url
:
jdbc:mysql://
localhost:3307/mes-new
?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://
192.168.222.136:3306/xm_mes_dev
?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
root
username
:
admin
password
:
123456
password
:
t0psunit
# 从库数据源
# 从库数据源
slave
:
slave
:
# 从数据源开关/默认关闭
# 从数据源开关/默认关闭
...
...
admin/src/main/resources/application.yml
View file @
529b699c
...
@@ -3,4 +3,4 @@ spring:
...
@@ -3,4 +3,4 @@ spring:
name
:
mes
name
:
mes
profiles
:
profiles
:
active
:
active
:
-
test
-
dev
framework/src/main/java/com/ximai/framework/config/MybatisPlusConfig.java
deleted
100644 → 0
View file @
7d5744e3
package
com
.
ximai
.
framework
.
config
;
import
com.baomidou.mybatisplus.autoconfigure.SpringBootVFS
;
import
com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor
;
import
com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean
;
import
com.github.pagehelper.PageInterceptor
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.io.DefaultResourceLoader
;
import
org.springframework.core.io.Resource
;
import
org.springframework.core.io.support.PathMatchingResourcePatternResolver
;
import
org.springframework.core.io.support.ResourcePatternResolver
;
import
org.springframework.core.type.classreading.CachingMetadataReaderFactory
;
import
org.springframework.core.type.classreading.MetadataReader
;
import
org.springframework.core.type.classreading.MetadataReaderFactory
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.apache.ibatis.io.VFS
;
import
org.springframework.util.ClassUtils
;
import
javax.sql.DataSource
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashSet
;
import
java.util.List
;
/**
* @ Author: chicheng.li
* @ Date : 2024/1/25
*/
@Configuration
@EnableTransactionManagement
public
class
MybatisPlusConfig
{
static
final
String
DEFAULT_RESOURCE_PATTERN
=
"**/*.class"
;
@Autowired
private
Environment
env
;
/**
* 分页插件
*/
@Bean
public
PaginationInterceptor
paginationInterceptor
()
{
return
new
PaginationInterceptor
();
}
/**
* pagehelper的分页插件
*/
@Bean
public
PageInterceptor
pageInterceptor
()
{
return
new
PageInterceptor
();
}
/*@Bean
public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception {
String mapperLocations = env.getProperty("mybatis-plus.mapper-locations");
//String configLocation = env.getProperty("mybatis-plus.config-location");
VFS.addImplClass(SpringBootVFS.class);
final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
sessionFactory.setDataSource(dataSource);
String typeAliasesPackage = setTypeAliasesPackage("com.ximai.**.domain");
sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(mapperLocations));
//sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
return sessionFactory.getObject();
}*/
public
static
String
setTypeAliasesPackage
(
String
typeAliasesPackage
)
{
ResourcePatternResolver
resolver
=
(
ResourcePatternResolver
)
new
PathMatchingResourcePatternResolver
();
MetadataReaderFactory
metadataReaderFactory
=
new
CachingMetadataReaderFactory
(
resolver
);
List
<
String
>
allResult
=
new
ArrayList
<
String
>();
try
{
for
(
String
aliasesPackage
:
typeAliasesPackage
.
split
(
","
))
{
List
<
String
>
result
=
new
ArrayList
<
String
>();
aliasesPackage
=
ResourcePatternResolver
.
CLASSPATH_ALL_URL_PREFIX
+
ClassUtils
.
convertClassNameToResourcePath
(
aliasesPackage
.
trim
())
+
"/"
+
DEFAULT_RESOURCE_PATTERN
;
Resource
[]
resources
=
resolver
.
getResources
(
aliasesPackage
);
if
(
resources
!=
null
&&
resources
.
length
>
0
)
{
MetadataReader
metadataReader
=
null
;
for
(
Resource
resource
:
resources
)
{
if
(
resource
.
isReadable
())
{
metadataReader
=
metadataReaderFactory
.
getMetadataReader
(
resource
);
try
{
result
.
add
(
Class
.
forName
(
metadataReader
.
getClassMetadata
().
getClassName
()).
getPackage
().
getName
());
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
}
}
}
if
(
result
.
size
()
>
0
)
{
HashSet
<
String
>
hashResult
=
new
HashSet
<
String
>(
result
);
allResult
.
addAll
(
hashResult
);
}
}
if
(
allResult
.
size
()
>
0
)
{
typeAliasesPackage
=
String
.
join
(
","
,
(
String
[])
allResult
.
toArray
(
new
String
[
0
]));
}
else
{
throw
new
RuntimeException
(
"mybatis typeAliasesPackage 路径扫描错误,参数typeAliasesPackage:"
+
typeAliasesPackage
+
"未找到任何包"
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
typeAliasesPackage
;
}
public
Resource
[]
resolveMapperLocations
(
String
[]
mapperLocations
)
{
ResourcePatternResolver
resourceResolver
=
new
PathMatchingResourcePatternResolver
();
List
<
Resource
>
resources
=
new
ArrayList
<
Resource
>();
if
(
mapperLocations
!=
null
)
{
for
(
String
mapperLocation
:
mapperLocations
)
{
try
{
Resource
[]
mappers
=
resourceResolver
.
getResources
(
mapperLocation
);
resources
.
addAll
(
Arrays
.
asList
(
mappers
));
}
catch
(
IOException
e
)
{
// ignore
}
}
}
return
resources
.
toArray
(
new
Resource
[
resources
.
size
()]);
}
}
framework/src/main/java/com/ximai/framework/config/SecurityConfig.java
View file @
529b699c
...
@@ -104,6 +104,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -104,6 +104,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/profile/**"
"/profile/**"
).
permitAll
()
).
permitAll
()
.
antMatchers
(
"/swagger-ui.html"
).
anonymous
()
.
antMatchers
(
"/swagger-ui.html"
).
anonymous
()
.
antMatchers
(
"*/doc.html"
).
anonymous
()
.
antMatchers
(
"/ureport/**"
).
anonymous
()
.
antMatchers
(
"/ureport/**"
).
anonymous
()
.
antMatchers
(
"/swagger-resources/**"
).
anonymous
()
.
antMatchers
(
"/swagger-resources/**"
).
anonymous
()
.
antMatchers
(
"/webjars/**"
).
anonymous
()
.
antMatchers
(
"/webjars/**"
).
anonymous
()
...
...
generator/src/main/java/com/ximai/generator/service/GenTableServiceImpl.java
View file @
529b699c
...
@@ -249,6 +249,33 @@ public class GenTableServiceImpl implements IGenTableService {
...
@@ -249,6 +249,33 @@ public class GenTableServiceImpl implements IGenTableService {
}
}
}
}
@Override
public
void
generatorCode
(
GenTable
table
)
{
// 设置主键列信息
setPkColumn
(
table
);
VelocityInitializer
.
initVelocity
();
VelocityContext
context
=
VelocityUtils
.
prepareContext
(
table
);
// 获取模板列表
List
<
String
>
templates
=
VelocityUtils
.
getTemplateList
(
table
.
getTplCategory
());
for
(
String
template
:
templates
)
{
if
(!
StringUtils
.
containsAny
(
template
,
"sql.vm"
,
"api.js.vm"
,
"index.vue.vm"
,
"index-tree.vue.vm"
))
{
// 渲染模板
StringWriter
sw
=
new
StringWriter
();
Template
tpl
=
Velocity
.
getTemplate
(
template
,
Constants
.
UTF8
);
tpl
.
merge
(
context
,
sw
);
try
{
String
path
=
getGenPath
(
table
,
template
);
FileUtils
.
writeStringToFile
(
new
File
(
path
),
sw
.
toString
(),
CharsetKit
.
UTF_8
);
}
catch
(
IOException
e
)
{
throw
new
ServiceException
(
"渲染模板失败,表名:"
+
table
.
getTableName
());
}
}
}
}
/**
/**
* 同步数据库
* 同步数据库
*
*
...
@@ -446,7 +473,7 @@ public class GenTableServiceImpl implements IGenTableService {
...
@@ -446,7 +473,7 @@ public class GenTableServiceImpl implements IGenTableService {
public
static
String
getGenPath
(
GenTable
table
,
String
template
)
{
public
static
String
getGenPath
(
GenTable
table
,
String
template
)
{
String
genPath
=
table
.
getGenPath
();
String
genPath
=
table
.
getGenPath
();
if
(
StringUtils
.
equals
(
genPath
,
"/"
))
{
if
(
StringUtils
.
equals
(
genPath
,
"/"
))
{
return
System
.
getProperty
(
"user.dir"
)
+
File
.
separator
+
"src"
+
File
.
separator
+
VelocityUtils
.
getFileName
(
template
,
table
);
return
System
.
getProperty
(
"user.dir"
)
+
File
.
separator
+
"
mes/
src"
+
File
.
separator
+
VelocityUtils
.
getFileName
(
template
,
table
);
}
}
return
genPath
+
File
.
separator
+
VelocityUtils
.
getFileName
(
template
,
table
);
return
genPath
+
File
.
separator
+
VelocityUtils
.
getFileName
(
template
,
table
);
}
}
...
...
generator/src/main/java/com/ximai/generator/service/IGenTableService.java
View file @
529b699c
...
@@ -96,6 +96,14 @@ public interface IGenTableService
...
@@ -96,6 +96,14 @@ public interface IGenTableService
*/
*/
public
void
generatorCode
(
String
tableName
);
public
void
generatorCode
(
String
tableName
);
/**
* 生成代码(自定义路径)
*
* @param table 表名称
* @return 数据
*/
public
void
generatorCode
(
GenTable
table
);
/**
/**
* 同步数据库
* 同步数据库
*
*
...
...
generator/src/main/java/com/ximai/generator/util/VelocityUtils.java
View file @
529b699c
...
@@ -128,6 +128,11 @@ public class VelocityUtils
...
@@ -128,6 +128,11 @@ public class VelocityUtils
{
{
List
<
String
>
templates
=
new
ArrayList
<
String
>();
List
<
String
>
templates
=
new
ArrayList
<
String
>();
templates
.
add
(
"vm/java/domain.java.vm"
);
templates
.
add
(
"vm/java/domain.java.vm"
);
templates
.
add
(
"vm/java/dto-query.java.vm"
);
templates
.
add
(
"vm/java/dto-create.java.vm"
);
templates
.
add
(
"vm/java/dto-update.java.vm"
);
templates
.
add
(
"vm/java/dto-excelExport.java.vm"
);
templates
.
add
(
"vm/java/dto-excelImport.java.vm"
);
templates
.
add
(
"vm/java/mapper.java.vm"
);
templates
.
add
(
"vm/java/mapper.java.vm"
);
templates
.
add
(
"vm/java/service.java.vm"
);
templates
.
add
(
"vm/java/service.java.vm"
);
templates
.
add
(
"vm/java/serviceImpl.java.vm"
);
templates
.
add
(
"vm/java/serviceImpl.java.vm"
);
...
@@ -175,6 +180,26 @@ public class VelocityUtils
...
@@ -175,6 +180,26 @@ public class VelocityUtils
{
{
fileName
=
StringUtils
.
format
(
"{}/domain/{}.java"
,
javaPath
,
className
);
fileName
=
StringUtils
.
format
(
"{}/domain/{}.java"
,
javaPath
,
className
);
}
}
if
(
template
.
contains
(
"dto-query.java.vm"
))
{
fileName
=
StringUtils
.
format
(
"{}/dto/{}Dto.java"
,
javaPath
,
className
);
}
if
(
template
.
contains
(
"dto-create.java.vm"
))
{
fileName
=
StringUtils
.
format
(
"{}/dto/{}Create.java"
,
javaPath
,
className
);
}
if
(
template
.
contains
(
"dto-update.java.vm"
))
{
fileName
=
StringUtils
.
format
(
"{}/dto/{}Update.java"
,
javaPath
,
className
);
}
if
(
template
.
contains
(
"dto-excelImport.java.vm"
))
{
fileName
=
StringUtils
.
format
(
"{}/dto/{}ExcelImport.java"
,
javaPath
,
className
);
}
if
(
template
.
contains
(
"dto-excelExport.java.vm"
))
{
fileName
=
StringUtils
.
format
(
"{}/dto/{}ExcelExport.java"
,
javaPath
,
className
);
}
if
(
template
.
contains
(
"sub-domain.java.vm"
)
&&
StringUtils
.
equals
(
GenConstants
.
TPL_SUB
,
genTable
.
getTplCategory
()))
if
(
template
.
contains
(
"sub-domain.java.vm"
)
&&
StringUtils
.
equals
(
GenConstants
.
TPL_SUB
,
genTable
.
getTplCategory
()))
{
{
fileName
=
StringUtils
.
format
(
"{}/domain/{}.java"
,
javaPath
,
genTable
.
getSubTable
().
getClassName
());
fileName
=
StringUtils
.
format
(
"{}/domain/{}.java"
,
javaPath
,
genTable
.
getSubTable
().
getClassName
());
...
...
generator/src/main/resources/vm/java/controller.java.vm
View file @
529b699c
...
@@ -16,9 +16,15 @@ import com.ximai.common.annotation.Log;
...
@@ -16,9 +16,15 @@ import com.ximai.common.annotation.Log;
import
com
.
ximai
.
common
.
core
.
controller
.
BaseController
;
import
com
.
ximai
.
common
.
core
.
controller
.
BaseController
;
import
com
.
ximai
.
common
.
core
.
domain
.
AjaxResult
;
import
com
.
ximai
.
common
.
core
.
domain
.
AjaxResult
;
import
com
.
ximai
.
common
.
enums
.
BusinessType
;
import
com
.
ximai
.
common
.
enums
.
BusinessType
;
import
io
.
swagger
.
annotations
.
ApiOperation
;
import
${
packageName
}.
domain
.${
ClassName
};
import
${
packageName
}.
domain
.${
ClassName
};
import
${
packageName
}.
dto
.${
ClassName
}
Dto
;
import
${
packageName
}.
dto
.${
ClassName
}
Create
;
import
${
packageName
}.
dto
.${
ClassName
}
Update
;
import
${
packageName
}.
dto
.${
ClassName
}
ExcelExport
;
import
${
packageName
}.
service
.
I
${
ClassName
}
Service
;
import
${
packageName
}.
service
.
I
${
ClassName
}
Service
;
import
com
.
ximai
.
common
.
utils
.
poi
.
ExcelUtil
;
import
com
.
ximai
.
common
.
utils
.
poi
.
ExcelUtil
;
import
cn
.
hutool
.
core
.
bean
.
BeanUtil
;
#
if
($
table
.
crud
||
$
table
.
sub
)
#
if
($
table
.
crud
||
$
table
.
sub
)
import
com
.
ximai
.
common
.
core
.
page
.
TableDataInfo
;
import
com
.
ximai
.
common
.
core
.
page
.
TableDataInfo
;
#
elseif
($
table
.
tree
)
#
elseif
($
table
.
tree
)
...
@@ -40,19 +46,20 @@ public class ${ClassName}Controller extends BaseController
...
@@ -40,19 +46,20 @@ public class ${ClassName}Controller extends BaseController
/**
/**
*
查询
${
functionName
}
列表
*
查询
${
functionName
}
列表
*/
*/
@
ApiOperation
(
"查询${functionName}列表"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:list')"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:list')"
)
@
GetMapping
(
"/list"
)
@
GetMapping
(
"/list"
)
#
if
($
table
.
crud
||
$
table
.
sub
)
#
if
($
table
.
crud
||
$
table
.
sub
)
public
TableDataInfo
list
(${
ClassName
}
${
className
})
public
TableDataInfo
<${
ClassName
}
Dto
>
list
(${
ClassName
}
${
className
})
{
{
startPage
();
startPage
();
List
<${
ClassName
}>
list
=
${
className
}
Service
.
select
${
ClassName
}
List
(${
className
});
List
<${
ClassName
}
Dto
>
list
=
${
className
}
Service
.
select
${
ClassName
}
List
(${
className
});
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
#
elseif
($
table
.
tree
)
#
elseif
($
table
.
tree
)
public
AjaxResult
list
(${
ClassName
}
${
className
})
public
AjaxResult
<${
ClassName
}
Dto
>
list
(${
ClassName
}
${
className
})
{
{
List
<${
ClassName
}>
list
=
${
className
}
Service
.
select
${
ClassName
}
List
(${
className
});
List
<${
ClassName
}
Dto
>
list
=
${
className
}
Service
.
select
${
ClassName
}
List
(${
className
});
return
AjaxResult
.
success
(
list
);
return
AjaxResult
.
success
(
list
);
}
}
#
end
#
end
...
@@ -60,51 +67,57 @@ public class ${ClassName}Controller extends BaseController
...
@@ -60,51 +67,57 @@ public class ${ClassName}Controller extends BaseController
/**
/**
*
导出
${
functionName
}
列表
*
导出
${
functionName
}
列表
*/
*/
@
ApiOperation
(
"导出${functionName}列表"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:export')"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:export')"
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
EXPORT
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
EXPORT
)
@
PostMapping
(
"/export"
)
@
PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
${
ClassName
}
${
className
})
public
void
export
(
HttpServletResponse
response
,
${
ClassName
}
${
className
})
{
{
List
<${
ClassName
}>
list
=
${
className
}
Service
.
select
${
ClassName
}
List
(${
className
});
List
<${
ClassName
}
Dto
>
list
=
${
className
}
Service
.
select
${
ClassName
}
List
(${
className
});
ExcelUtil
<${
ClassName
}>
util
=
new
ExcelUtil
<${
ClassName
}>(${
ClassName
}.
class
);
ExcelUtil
<${
ClassName
}
ExcelExport
>
util
=
new
ExcelUtil
<${
ClassName
}
ExcelExport
>(${
ClassName
}
ExcelExport
.
class
);
util
.
exportExcel
(
response
,
list
,
"${functionName}数据"
);
List
<${
ClassName
}
ExcelExport
>
tempList
=
BeanUtil
.
copyToList
(
list
,
${
ClassName
}
ExcelExport
.
class
);
util
.
exportExcel
(
response
,
tempList
,
"${functionName}数据"
);
}
}
/**
/**
*
获取
${
functionName
}
详细信息
*
获取
${
functionName
}
详细信息
*/
*/
@
ApiOperation
(
"获取${functionName}详细信息"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:query')"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:query')"
)
@
GetMapping
(
value
=
"/{${pkColumn.javaField}}"
)
@
GetMapping
(
value
=
"/{${pkColumn.javaField}}"
)
public
AjaxResult
getInfo
(@
PathVariable
(
"${pkColumn.javaField}"
)
${
pkColumn
.
javaType
}
${
pkColumn
.
javaField
})
public
AjaxResult
<${
ClassName
}
Dto
>
getInfo
(@
PathVariable
(
"${pkColumn.javaField}"
)
${
pkColumn
.
javaType
}
${
pkColumn
.
javaField
})
{
{
return
AjaxResult
.
success
(${
className
}
Service
.
select
${
ClassName
}
By
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaField
}));
return
AjaxResult
.
success
(${
className
}
Service
.
select
${
ClassName
}
Dto
By
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaField
}));
}
}
/**
/**
*
新增
${
functionName
}
*
新增
${
functionName
}
*/
*/
@
ApiOperation
(
"新增${functionName}"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:add')"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:add')"
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
INSERT
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
INSERT
)
@
PostMapping
@
PostMapping
public
AjaxResult
add
(@
RequestBody
${
ClassName
}
${
className
}
)
public
AjaxResult
add
(@
RequestBody
${
ClassName
}
Create
${
className
}
Create
)
{
{
return
toAjax
(${
className
}
Service
.
insert
${
ClassName
}(${
className
}));
return
toAjax
(${
className
}
Service
.
insert
${
ClassName
}(${
className
}
Create
));
}
}
/**
/**
*
修改
${
functionName
}
*
修改
${
functionName
}
*/
*/
@
ApiOperation
(
"修改${functionName}"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:edit')"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:edit')"
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
UPDATE
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
UPDATE
)
@
PutMapping
@
PutMapping
public
AjaxResult
edit
(@
RequestBody
${
ClassName
}
${
className
}
)
public
AjaxResult
edit
(@
RequestBody
${
ClassName
}
Update
${
className
}
Update
)
{
{
return
toAjax
(${
className
}
Service
.
update
${
ClassName
}(${
className
}));
return
toAjax
(${
className
}
Service
.
update
${
ClassName
}(${
className
}
Update
));
}
}
/**
/**
*
删除
${
functionName
}
*
删除
${
functionName
}
*/
*/
@
ApiOperation
(
"删除${functionName}"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:remove')"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:remove')"
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
DELETE
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
DELETE
)
@
DeleteMapping
(
"/{${pkColumn.javaField}s}"
)
@
DeleteMapping
(
"/{${pkColumn.javaField}s}"
)
...
...
generator/src/main/resources/vm/java/domain.java.vm
View file @
529b699c
...
@@ -3,10 +3,13 @@ package ${packageName}.domain;
...
@@ -3,10 +3,13 @@ package ${packageName}.domain;
#
foreach
($
import
in
$
importList
)
#
foreach
($
import
in
$
importList
)
import
${
import
};
import
${
import
};
#
end
#
end
import
com
.
ximai
.
common
.
annotation
.
Excel
;
import
io
.
swagger
.
annotations
.
ApiModelProperty
;
import
com
.
baomidou
.
mybatisplus
.
annotation
.
TableId
;
import
com
.
baomidou
.
mybatisplus
.
annotation
.
TableId
;
import
lombok
.
Data
;
#
if
($
table
.
crud
||
$
table
.
sub
)
#
if
($
table
.
crud
||
$
table
.
sub
)
import
com
.
ximai
.
common
.
core
.
domain
.
BaseEntity
;
#
elseif
($
table
.
tree
)
#
elseif
($
table
.
tree
)
import
com
.
ximai
.
common
.
core
.
domain
.
TreeEntity
;
#
end
#
end
/**
/**
...
@@ -20,8 +23,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
...
@@ -20,8 +23,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
#
elseif
($
table
.
tree
)
#
elseif
($
table
.
tree
)
#
set
($
Entity
=
"TreeEntity"
)
#
set
($
Entity
=
"TreeEntity"
)
#
end
#
end
public
class
${
ClassName
}
extends
${
Entity
}
@
Data
{
public
class
${
ClassName
}
extends
${
Entity
}
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
#
foreach
($
column
in
$
columns
)
#
foreach
($
column
in
$
columns
)
...
@@ -35,12 +38,12 @@ public class ${ClassName} extends ${Entity}
...
@@ -35,12 +38,12 @@ public class ${ClassName} extends ${Entity}
#
set
($
comment
=$
column
.
columnComment
)
#
set
($
comment
=$
column
.
columnComment
)
#
end
#
end
#
if
($
parentheseIndex
!= -1)
#
if
($
parentheseIndex
!= -1)
@
Excel
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
@
ApiModelProperty
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
#
elseif
($
column
.
javaType
==
'Date'
)
#
elseif
($
column
.
javaType
==
'Date'
)
@
JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@
JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@
Excel
(
name
=
"${comment}"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd
"
)
@
ApiModelProperty
(
name
=
"${comment}
"
)
#
else
#
else
@
Excel
(
name
=
"${comment}"
)
@
ApiModelProperty
(
name
=
"${comment}"
)
#
end
#
end
#
end
#
end
#
if
($
column
.
javaField
==
$
pkColumn
.
javaField
)
#
if
($
column
.
javaField
==
$
pkColumn
.
javaField
)
...
@@ -55,51 +58,6 @@ public class ${ClassName} extends ${Entity}
...
@@ -55,51 +58,6 @@ public class ${ClassName} extends ${Entity}
private
List
<${
subClassName
}>
${
subclassName
}
List
;
private
List
<${
subClassName
}>
${
subclassName
}
List
;
#
end
#
end
#
foreach
($
column
in
$
columns
)
#
if
(
!$table.isSuperColumn($column.javaField))
#
if
($
column
.
javaField
.
length
()
>
2
&&
$
column
.
javaField
.
substring
(
1
,
2
).
matches
(
"[A-Z]"
))
#
set
($
AttrName
=$
column
.
javaField
)
#
else
#
set
($
AttrName
=$
column
.
javaField
.
substring
(
0
,
1
).
toUpperCase
()
+
${
column
.
javaField
.
substring
(
1
)})
#
end
public
void
set
${
AttrName
}($
column
.
javaType
$
column
.
javaField
)
{
this
.$
column
.
javaField
=
$
column
.
javaField
;
}
public
$
column
.
javaType
get
${
AttrName
}()
{
return
$
column
.
javaField
;
}
#
end
#
end
#
if
($
table
.
sub
)
public
List
<${
subClassName
}>
get
${
subClassName
}
List
()
{
return
${
subclassName
}
List
;
}
public
void
set
${
subClassName
}
List
(
List
<${
subClassName
}>
${
subclassName
}
List
)
{
this
.${
subclassName
}
List
=
${
subclassName
}
List
;
}
#
end
@
Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
#
foreach
($
column
in
$
columns
)
#
if
($
column
.
javaField
.
length
()
>
2
&&
$
column
.
javaField
.
substring
(
1
,
2
).
matches
(
"[A-Z]"
))
#
set
($
AttrName
=$
column
.
javaField
)
#
else
#
set
($
AttrName
=$
column
.
javaField
.
substring
(
0
,
1
).
toUpperCase
()
+
${
column
.
javaField
.
substring
(
1
)})
#
end
.
append
(
"${column.javaField}"
,
get
${
AttrName
}())
#
end
#
if
($
table
.
sub
)
.
append
(
"${subclassName}List"
,
get
${
subClassName
}
List
())
#
end
.
toString
();
}
}
}
generator/src/main/resources/vm/java/dto-create.java.vm
0 → 100644
View file @
529b699c
package
${
packageName
}.
dto
;
#
foreach
($
import
in
$
importList
)
import
${
import
};
#
end
import
io
.
swagger
.
annotations
.
ApiModelProperty
;
import
com
.
baomidou
.
mybatisplus
.
annotation
.
TableId
;
import
lombok
.
Data
;
/**
*
${
functionName
}
对象
${
tableName
}
*
*
@
author
${
author
}
*
@
date
${
datetime
}
*/
@
Data
public
class
${
ClassName
}
Create
{
private
static
final
long
serialVersionUID
=
1L
;
#
foreach
($
column
in
$
columns
)
#
if
(
!$table.isSuperColumn($column.javaField))
/**
$
column
.
columnComment
*/
#
if
($
column
.
list
)
#
set
($
parentheseIndex
=$
column
.
columnComment
.
indexOf
(
"("
))
#
if
($
parentheseIndex
!= -1)
#
set
($
comment
=$
column
.
columnComment
.
substring
(
0
,
$
parentheseIndex
))
#
else
#
set
($
comment
=$
column
.
columnComment
)
#
end
#
if
($
parentheseIndex
!= -1)
@
ApiModelProperty
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
#
elseif
($
column
.
javaType
==
'Date'
)
@
JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@
ApiModelProperty
(
name
=
"${comment}"
)
#
else
@
ApiModelProperty
(
name
=
"${comment}"
)
#
end
#
end
#
if
($
column
.
javaField
==
$
pkColumn
.
javaField
)
@
TableId
#
end
private
$
column
.
javaType
$
column
.
javaField
;
#
end
#
end
#
if
($
table
.
sub
)
/**
$
table
.
subTable
.
functionName
信息
*/
private
List
<${
subClassName
}>
${
subclassName
}
List
;
#
end
}
generator/src/main/resources/vm/java/dto-excelExport.java.vm
0 → 100644
View file @
529b699c
package
${
packageName
}.
dto
;
#
foreach
($
import
in
$
importList
)
import
${
import
};
#
end
import
com
.
ximai
.
common
.
annotation
.
Excel
;
import
io
.
swagger
.
annotations
.
ApiModelProperty
;
import
com
.
baomidou
.
mybatisplus
.
annotation
.
TableId
;
import
lombok
.
Data
;
#
if
($
table
.
crud
||
$
table
.
sub
)
import
com
.
ximai
.
common
.
core
.
domain
.
BaseEntity
;
#
elseif
($
table
.
tree
)
import
com
.
ximai
.
common
.
core
.
domain
.
TreeEntity
;
#
end
/**
*
${
functionName
}
对象
${
tableName
}
*
*
@
author
${
author
}
*
@
date
${
datetime
}
*/
@
Data
public
class
${
ClassName
}
ExcelExport
{
private
static
final
long
serialVersionUID
=
1L
;
#
foreach
($
column
in
$
columns
)
#
if
(
!$table.isSuperColumn($column.javaField))
/**
$
column
.
columnComment
*/
#
if
($
column
.
list
)
#
set
($
parentheseIndex
=$
column
.
columnComment
.
indexOf
(
"("
))
#
if
($
parentheseIndex
!= -1)
#
set
($
comment
=$
column
.
columnComment
.
substring
(
0
,
$
parentheseIndex
))
#
else
#
set
($
comment
=$
column
.
columnComment
)
#
end
#
if
($
parentheseIndex
!= -1)
@
ApiModelProperty
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
@
Excel
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
#
elseif
($
column
.
javaType
==
'Date'
)
@
JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@
ApiModelProperty
(
name
=
"${comment}"
)
@
Excel
(
name
=
"${comment}"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
#
else
@
ApiModelProperty
(
name
=
"${comment}"
)
@
Excel
(
name
=
"${comment}"
)
#
end
#
end
#
if
($
column
.
javaField
==
$
pkColumn
.
javaField
)
@
TableId
#
end
private
$
column
.
javaType
$
column
.
javaField
;
#
end
#
end
#
if
($
table
.
sub
)
/**
$
table
.
subTable
.
functionName
信息
*/
private
List
<${
subClassName
}>
${
subclassName
}
List
;
#
end
}
generator/src/main/resources/vm/java/dto-excelImport.java.vm
0 → 100644
View file @
529b699c
package
${
packageName
}.
dto
;
#
foreach
($
import
in
$
importList
)
import
${
import
};
#
end
import
com
.
ximai
.
common
.
annotation
.
Excel
;
import
io
.
swagger
.
annotations
.
ApiModelProperty
;
import
com
.
baomidou
.
mybatisplus
.
annotation
.
TableId
;
import
lombok
.
Data
;
#
if
($
table
.
crud
||
$
table
.
sub
)
import
com
.
ximai
.
common
.
core
.
domain
.
BaseEntity
;
#
elseif
($
table
.
tree
)
import
com
.
ximai
.
common
.
core
.
domain
.
TreeEntity
;
#
end
/**
*
${
functionName
}
对象
${
tableName
}
*
*
@
author
${
author
}
*
@
date
${
datetime
}
*/
@
Data
public
class
${
ClassName
}
ExcelImport
{
private
static
final
long
serialVersionUID
=
1L
;
#
foreach
($
column
in
$
columns
)
#
if
(
!$table.isSuperColumn($column.javaField))
/**
$
column
.
columnComment
*/
#
if
($
column
.
list
)
#
set
($
parentheseIndex
=$
column
.
columnComment
.
indexOf
(
"("
))
#
if
($
parentheseIndex
!= -1)
#
set
($
comment
=$
column
.
columnComment
.
substring
(
0
,
$
parentheseIndex
))
#
else
#
set
($
comment
=$
column
.
columnComment
)
#
end
#
if
($
parentheseIndex
!= -1)
@
ApiModelProperty
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
@
Excel
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
#
elseif
($
column
.
javaType
==
'Date'
)
@
JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@
ApiModelProperty
(
name
=
"${comment}"
)
@
Excel
(
name
=
"${comment}"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
#
else
@
ApiModelProperty
(
name
=
"${comment}"
)
@
Excel
(
name
=
"${comment}"
)
#
end
#
end
#
if
($
column
.
javaField
==
$
pkColumn
.
javaField
)
@
TableId
#
end
private
$
column
.
javaType
$
column
.
javaField
;
#
end
#
end
#
if
($
table
.
sub
)
/**
$
table
.
subTable
.
functionName
信息
*/
private
List
<${
subClassName
}>
${
subclassName
}
List
;
#
end
}
generator/src/main/resources/vm/java/dto-query.java.vm
0 → 100644
View file @
529b699c
package
${
packageName
}.
dto
;
#
foreach
($
import
in
$
importList
)
import
${
import
};
#
end
import
io
.
swagger
.
annotations
.
ApiModelProperty
;
import
com
.
baomidou
.
mybatisplus
.
annotation
.
TableId
;
import
lombok
.
Data
;
/**
*
${
functionName
}
对象
${
tableName
}
*
*
@
author
${
author
}
*
@
date
${
datetime
}
*/
@
Data
public
class
${
ClassName
}
Dto
{
private
static
final
long
serialVersionUID
=
1L
;
#
foreach
($
column
in
$
columns
)
#
if
(
!$table.isSuperColumn($column.javaField))
/**
$
column
.
columnComment
*/
#
if
($
column
.
list
)
#
set
($
parentheseIndex
=$
column
.
columnComment
.
indexOf
(
"("
))
#
if
($
parentheseIndex
!= -1)
#
set
($
comment
=$
column
.
columnComment
.
substring
(
0
,
$
parentheseIndex
))
#
else
#
set
($
comment
=$
column
.
columnComment
)
#
end
#
if
($
parentheseIndex
!= -1)
@
ApiModelProperty
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
#
elseif
($
column
.
javaType
==
'Date'
)
@
JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@
ApiModelProperty
(
name
=
"${comment}"
)
#
else
@
ApiModelProperty
(
name
=
"${comment}"
)
#
end
#
end
#
if
($
column
.
javaField
==
$
pkColumn
.
javaField
)
@
TableId
#
end
private
$
column
.
javaType
$
column
.
javaField
;
#
end
#
end
#
if
($
table
.
sub
)
/**
$
table
.
subTable
.
functionName
信息
*/
private
List
<${
subClassName
}>
${
subclassName
}
List
;
#
end
}
generator/src/main/resources/vm/java/dto-update.java.vm
0 → 100644
View file @
529b699c
package
${
packageName
}.
dto
;
#
foreach
($
import
in
$
importList
)
import
${
import
};
#
end
import
io
.
swagger
.
annotations
.
ApiModelProperty
;
import
com
.
baomidou
.
mybatisplus
.
annotation
.
TableId
;
import
lombok
.
Data
;
/**
*
${
functionName
}
对象
${
tableName
}
*
*
@
author
${
author
}
*
@
date
${
datetime
}
*/
@
Data
public
class
${
ClassName
}
Update
{
private
static
final
long
serialVersionUID
=
1L
;
#
foreach
($
column
in
$
columns
)
#
if
(
!$table.isSuperColumn($column.javaField))
/**
$
column
.
columnComment
*/
#
if
($
column
.
list
)
#
set
($
parentheseIndex
=$
column
.
columnComment
.
indexOf
(
"("
))
#
if
($
parentheseIndex
!= -1)
#
set
($
comment
=$
column
.
columnComment
.
substring
(
0
,
$
parentheseIndex
))
#
else
#
set
($
comment
=$
column
.
columnComment
)
#
end
#
if
($
parentheseIndex
!= -1)
@
ApiModelProperty
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
#
elseif
($
column
.
javaType
==
'Date'
)
@
JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@
ApiModelProperty
(
name
=
"${comment}"
)
#
else
@
ApiModelProperty
(
name
=
"${comment}"
)
#
end
#
end
#
if
($
column
.
javaField
==
$
pkColumn
.
javaField
)
@
TableId
#
end
private
$
column
.
javaType
$
column
.
javaField
;
#
end
#
end
#
if
($
table
.
sub
)
/**
$
table
.
subTable
.
functionName
信息
*/
private
List
<${
subClassName
}>
${
subclassName
}
List
;
#
end
}
generator/src/main/resources/vm/java/mapper.java.vm
View file @
529b699c
...
@@ -3,6 +3,7 @@ package ${packageName}.mapper;
...
@@ -3,6 +3,7 @@ package ${packageName}.mapper;
import
java
.
util
.
List
;
import
java
.
util
.
List
;
import
com
.
baomidou
.
mybatisplus
.
core
.
mapper
.
BaseMapper
;
import
com
.
baomidou
.
mybatisplus
.
core
.
mapper
.
BaseMapper
;
import
${
packageName
}.
domain
.${
ClassName
};
import
${
packageName
}.
domain
.${
ClassName
};
import
${
packageName
}.
dto
.${
ClassName
}
Dto
;
#
if
($
table
.
sub
)
#
if
($
table
.
sub
)
import
${
packageName
}.
domain
.${
subClassName
};
import
${
packageName
}.
domain
.${
subClassName
};
#
end
#
end
...
@@ -21,7 +22,7 @@ public interface ${ClassName}Mapper extends BaseMapper<${ClassName}>
...
@@ -21,7 +22,7 @@ public interface ${ClassName}Mapper extends BaseMapper<${ClassName}>
*
@
param
${
pkColumn
.
javaField
}
${
functionName
}
主键
*
@
param
${
pkColumn
.
javaField
}
${
functionName
}
主键
*
@
return
${
functionName
}
*
@
return
${
functionName
}
*/
*/
public
${
ClassName
}
select
${
ClassName
}
By
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaType
}
${
pkColumn
.
javaField
});
public
${
ClassName
}
Dto
select
${
ClassName
}
By
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaType
}
${
pkColumn
.
javaField
});
/**
/**
*
查询
${
functionName
}
列表
*
查询
${
functionName
}
列表
...
@@ -29,7 +30,7 @@ public interface ${ClassName}Mapper extends BaseMapper<${ClassName}>
...
@@ -29,7 +30,7 @@ public interface ${ClassName}Mapper extends BaseMapper<${ClassName}>
*
@
param
${
className
}
${
functionName
}
*
@
param
${
className
}
${
functionName
}
*
@
return
${
functionName
}
集合
*
@
return
${
functionName
}
集合
*/
*/
public
List
<${
ClassName
}>
select
${
ClassName
}
List
(${
ClassName
}
${
className
});
public
List
<${
ClassName
}
Dto
>
select
${
ClassName
}
List
(${
ClassName
}
${
className
});
/**
/**
*
新增
${
functionName
}
*
新增
${
functionName
}
...
...
generator/src/main/resources/vm/java/service.java.vm
View file @
529b699c
package
${
packageName
}.
service
;
package
${
packageName
}.
service
;
import
java
.
util
.
List
;
import
java
.
util
.
List
;
import
com
.
baomidou
.
mybatisplus
.
core
.
conditions
.
query
.
QueryWrapper
;
import
${
packageName
}.
domain
.${
ClassName
};
import
${
packageName
}.
domain
.${
ClassName
};
import
${
packageName
}.
dto
.${
ClassName
}
Create
;
import
${
packageName
}.
dto
.${
ClassName
}
Update
;
import
${
packageName
}.
dto
.${
ClassName
}
Dto
;
/**
/**
*
${
functionName
}
Service
接口
*
${
functionName
}
Service
接口
...
@@ -11,6 +15,14 @@ import ${packageName}.domain.${ClassName};
...
@@ -11,6 +15,14 @@ import ${packageName}.domain.${ClassName};
*/
*/
public
interface
I
${
ClassName
}
Service
public
interface
I
${
ClassName
}
Service
{
{
/**
*
查询
${
functionName
}
*
*
@
param
${
pkColumn
.
javaField
}
${
functionName
}
主键
*
@
return
${
functionName
}
*/
public
${
ClassName
}
Dto
select
${
ClassName
}
DtoBy
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaType
}
${
pkColumn
.
javaField
});
/**
/**
*
查询
${
functionName
}
*
查询
${
functionName
}
*
*
...
@@ -25,7 +37,15 @@ public interface I${ClassName}Service
...
@@ -25,7 +37,15 @@ public interface I${ClassName}Service
*
@
param
${
className
}
${
functionName
}
*
@
param
${
className
}
${
functionName
}
*
@
return
${
functionName
}
集合
*
@
return
${
functionName
}
集合
*/
*/
public
List
<${
ClassName
}>
select
${
ClassName
}
List
(${
ClassName
}
${
className
});
public
List
<${
ClassName
}
Dto
>
select
${
ClassName
}
List
(${
ClassName
}
${
className
});
/**
*
查询
${
functionName
}
列表
*
*
@
param
${
className
}
Query
${
functionName
}
*
@
return
${
functionName
}
集合
*/
public
List
<${
ClassName
}>
select
${
ClassName
}
List
(
QueryWrapper
<${
ClassName
}>
${
className
}
Query
);
/**
/**
*
新增
${
functionName
}
*
新增
${
functionName
}
...
@@ -33,7 +53,7 @@ public interface I${ClassName}Service
...
@@ -33,7 +53,7 @@ public interface I${ClassName}Service
*
@
param
${
className
}
${
functionName
}
*
@
param
${
className
}
${
functionName
}
*
@
return
结果
*
@
return
结果
*/
*/
public
int
insert
${
ClassName
}(${
ClassName
}
${
className
});
public
int
insert
${
ClassName
}(${
ClassName
}
Create
${
className
});
/**
/**
*
修改
${
functionName
}
*
修改
${
functionName
}
...
@@ -41,7 +61,7 @@ public interface I${ClassName}Service
...
@@ -41,7 +61,7 @@ public interface I${ClassName}Service
*
@
param
${
className
}
${
functionName
}
*
@
param
${
className
}
${
functionName
}
*
@
return
结果
*
@
return
结果
*/
*/
public
int
update
${
ClassName
}(${
ClassName
}
${
className
});
public
int
update
${
ClassName
}(${
ClassName
}
Update
${
className
});
/**
/**
*
批量删除
${
functionName
}
*
批量删除
${
functionName
}
...
...
generator/src/main/resources/vm/java/serviceImpl.java.vm
View file @
529b699c
package
${
packageName
}.
service
.
impl
;
package
${
packageName
}.
service
.
impl
;
import
java
.
util
.
List
;
import
java
.
util
.
List
;
import
com
.
baomidou
.
mybatisplus
.
core
.
conditions
.
query
.
QueryWrapper
;
#
foreach
($
column
in
$
columns
)
#
foreach
($
column
in
$
columns
)
#
if
($
column
.
javaField
==
'createTime'
||
$
column
.
javaField
==
'updateTime'
)
#
if
($
column
.
javaField
==
'createTime'
||
$
column
.
javaField
==
'updateTime'
)
import
com
.
ximai
.
common
.
utils
.
data
.
DateUtils
;
import
com
.
ximai
.
common
.
utils
.
data
.
DateUtils
;
...
@@ -10,6 +11,7 @@ import com.ximai.common.utils.SecurityUtils;
...
@@ -10,6 +11,7 @@ import com.ximai.common.utils.SecurityUtils;
#
end
#
end
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
stereotype
.
Service
;
import
org
.
springframework
.
stereotype
.
Service
;
import
cn
.
hutool
.
core
.
bean
.
BeanUtil
;
#
if
($
table
.
sub
)
#
if
($
table
.
sub
)
import
java
.
util
.
ArrayList
;
import
java
.
util
.
ArrayList
;
import
com
.
ximai
.
common
.
utils
.
data
.
StringUtils
;
import
com
.
ximai
.
common
.
utils
.
data
.
StringUtils
;
...
@@ -18,6 +20,9 @@ import ${packageName}.domain.${subClassName};
...
@@ -18,6 +20,9 @@ import ${packageName}.domain.${subClassName};
#
end
#
end
import
${
packageName
}.
mapper
.${
ClassName
}
Mapper
;
import
${
packageName
}.
mapper
.${
ClassName
}
Mapper
;
import
${
packageName
}.
domain
.${
ClassName
};
import
${
packageName
}.
domain
.${
ClassName
};
import
${
packageName
}.
dto
.${
ClassName
}
Create
;
import
${
packageName
}.
dto
.${
ClassName
}
Update
;
import
${
packageName
}.
dto
.${
ClassName
}
Dto
;
import
${
packageName
}.
service
.
I
${
ClassName
}
Service
;
import
${
packageName
}.
service
.
I
${
ClassName
}
Service
;
/**
/**
...
@@ -39,11 +44,23 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
...
@@ -39,11 +44,23 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
*
@
return
${
functionName
}
*
@
return
${
functionName
}
*/
*/
@
Override
@
Override
public
${
ClassName
}
select
${
ClassName
}
By
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaType
}
${
pkColumn
.
javaField
})
public
${
ClassName
}
Dto
select
${
ClassName
}
Dto
By
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaType
}
${
pkColumn
.
javaField
})
{
{
return
${
className
}
Mapper
.
select
${
ClassName
}
By
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaField
});
return
${
className
}
Mapper
.
select
${
ClassName
}
By
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaField
});
}
}
/**
*
查询
${
functionName
}
*
*
@
param
${
pkColumn
.
javaField
}
${
functionName
}
主键
*
@
return
${
functionName
}
*/
@
Override
public
${
ClassName
}
select
${
ClassName
}
By
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaType
}
${
pkColumn
.
javaField
})
{
return
${
className
}
Mapper
.
selectById
(${
pkColumn
.
javaField
});
}
/**
/**
*
查询
${
functionName
}
列表
*
查询
${
functionName
}
列表
*
*
...
@@ -51,22 +68,34 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
...
@@ -51,22 +68,34 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
*
@
return
${
functionName
}
*
@
return
${
functionName
}
*/
*/
@
Override
@
Override
public
List
<${
ClassName
}>
select
${
ClassName
}
List
(${
ClassName
}
${
className
})
public
List
<${
ClassName
}
Dto
>
select
${
ClassName
}
List
(${
ClassName
}
${
className
})
{
{
return
${
className
}
Mapper
.
select
${
ClassName
}
List
(${
className
});
return
${
className
}
Mapper
.
select
${
ClassName
}
List
(${
className
});
}
}
/**
*
查询
${
functionName
}
列表
*
*
@
param
${
className
}
Query
${
functionName
}
*
@
return
${
functionName
}
*/
@
Override
public
List
<${
ClassName
}>
select
${
ClassName
}
List
(
QueryWrapper
<${
ClassName
}>
${
className
}
Query
)
{
return
${
className
}
Mapper
.
selectList
(${
className
}
Query
);
}
/**
/**
*
新增
${
functionName
}
*
新增
${
functionName
}
*
*
*
@
param
${
className
}
${
functionName
}
*
@
param
${
className
}
Create
${
functionName
}
*
@
return
结果
*
@
return
结果
*/
*/
#
if
($
table
.
sub
)
#
if
($
table
.
sub
)
@
Transactional
@
Transactional
#
end
#
end
@
Override
@
Override
public
int
insert
${
ClassName
}(${
ClassName
}
${
className
}
)
public
int
insert
${
ClassName
}(${
ClassName
}
Create
${
className
}
Create
)
{
{
#
foreach
($
column
in
$
columns
)
#
foreach
($
column
in
$
columns
)
#
if
($
column
.
javaField
==
'createTime'
)
#
if
($
column
.
javaField
==
'createTime'
)
...
@@ -81,6 +110,8 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
...
@@ -81,6 +110,8 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
insert
${
subClassName
}(${
className
});
insert
${
subClassName
}(${
className
});
return
rows
;
return
rows
;
#
else
#
else
${
ClassName
}
${
className
}
=
new
${
ClassName
}();
BeanUtil
.
copyProperties
(
proBom1Create
,
${
className
});
return
${
className
}
Mapper
.
insert
${
ClassName
}(${
className
});
return
${
className
}
Mapper
.
insert
${
ClassName
}(${
className
});
#
end
#
end
}
}
...
@@ -88,14 +119,14 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
...
@@ -88,14 +119,14 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
/**
/**
*
修改
${
functionName
}
*
修改
${
functionName
}
*
*
*
@
param
${
className
}
${
functionName
}
*
@
param
${
className
}
Update
${
functionName
}
*
@
return
结果
*
@
return
结果
*/
*/
#
if
($
table
.
sub
)
#
if
($
table
.
sub
)
@
Transactional
@
Transactional
#
end
#
end
@
Override
@
Override
public
int
update
${
ClassName
}(${
ClassName
}
${
className
}
)
public
int
update
${
ClassName
}(${
ClassName
}
Update
${
className
}
Update
)
{
{
#
foreach
($
column
in
$
columns
)
#
foreach
($
column
in
$
columns
)
#
if
($
column
.
javaField
==
'updateTime'
)
#
if
($
column
.
javaField
==
'updateTime'
)
...
@@ -109,6 +140,8 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
...
@@ -109,6 +140,8 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
${
className
}
Mapper
.
delete
${
subClassName
}
By
${
subTableFkClassName
}(${
className
}.
get
${
pkColumn
.
capJavaField
}());
${
className
}
Mapper
.
delete
${
subClassName
}
By
${
subTableFkClassName
}(${
className
}.
get
${
pkColumn
.
capJavaField
}());
insert
${
subClassName
}(${
className
});
insert
${
subClassName
}(${
className
});
#
end
#
end
${
ClassName
}
${
className
}
=
new
${
ClassName
}();
BeanUtil
.
copyProperties
(
proBom1Update
,
${
className
});
return
${
className
}
Mapper
.
update
${
ClassName
}(${
className
});
return
${
className
}
Mapper
.
update
${
ClassName
}(${
className
});
}
}
...
...
generator/src/main/resources/vm/xml/mapper.xml.vm
View file @
529b699c
...
@@ -5,9 +5,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -5,9 +5,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper
namespace=
"${packageName}.mapper.${ClassName}Mapper"
>
<mapper
namespace=
"${packageName}.mapper.${ClassName}Mapper"
>
<resultMap
type=
"${ClassName}"
id=
"${ClassName}Result"
>
<resultMap
type=
"${ClassName}"
id=
"${ClassName}Result"
>
#foreach ($column in $columns)
#foreach ($column in $columns)
<result
property=
"${column.javaField}"
column=
"${column.columnName}"
/>
<result
property=
"${column.javaField}"
column=
"${column.columnName}"
/>
#end
#end
</resultMap>
<resultMap
type=
"${packageName}.dto.${ClassName}Dto"
id=
"${ClassName}Result2"
>
#foreach ($column in $columns)
<result
property=
"${column.javaField}"
column=
"${column.columnName}"
/>
#end
</resultMap>
</resultMap>
#if($table.sub)
#if($table.sub)
...
@@ -26,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -26,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName}
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName}
</sql>
</sql>
<select
id=
"select${ClassName}List"
parameterType=
"${ClassName}"
resultMap=
"${ClassName}Result"
>
<select
id=
"select${ClassName}List"
parameterType=
"${ClassName}"
resultMap=
"${ClassName}Result
2
"
>
<include
refid=
"select${ClassName}Vo"
/>
<include
refid=
"select${ClassName}Vo"
/>
<where>
<where>
#foreach($column in $columns)
#foreach($column in $columns)
...
@@ -58,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -58,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</where>
</select>
</select>
<select
id=
"select${ClassName}By${pkColumn.capJavaField}"
parameterType=
"${pkColumn.javaType}"
resultMap=
"#if($table.sub)${ClassName}${subClassName}Result#else${ClassName}Result#end"
>
<select
id=
"select${ClassName}By${pkColumn.capJavaField}"
parameterType=
"${pkColumn.javaType}"
resultMap=
"#if($table.sub)${ClassName}${subClassName}Result#else${ClassName}Result
2
#end"
>
#if($table.crud || $table.tree)
#if($table.crud || $table.tree)
<include
refid=
"select${ClassName}Vo"
/>
<include
refid=
"select${ClassName}Vo"
/>
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
...
...
generator/src/test/java/com/ximai/generator/BuildUtil.java
0 → 100644
View file @
529b699c
package
com
.
ximai
.
generator
;
import
com.ximai.generator.domain.GenTable
;
import
com.ximai.generator.domain.GenTableColumn
;
import
com.ximai.generator.service.GenTableServiceImpl
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
BuildUtil
{
public
static
void
main
(
String
[]
args
)
{
GenTableServiceImpl
genTableService
=
new
GenTableServiceImpl
();
GenTable
genTable
=
new
GenTable
();
List
<
GenTableColumn
>
columns
=
new
ArrayList
<>();
columns
.
add
(
new
GenTableColumn
(){{
setColumnName
(
"process_name"
);
setColumnComment
(
"工序名称"
);
setColumnId
(
1
l
);
setJavaType
(
"String"
);
setJavaField
(
"processName"
);
setIsPk
(
"0"
);
setIsInsert
(
"1"
);
setIsEdit
(
"1"
);
setIsList
(
"1"
);
setIsQuery
(
"1"
);
setSort
(
1
);
}});
columns
.
add
(
new
GenTableColumn
(){{
setColumnName
(
"process_code"
);
setColumnComment
(
"工序编码"
);
setColumnId
(
2
l
);
setJavaType
(
"String"
);
setJavaField
(
"processCode"
);
setIsPk
(
"0"
);
setIsInsert
(
"1"
);
setIsEdit
(
"1"
);
setIsList
(
"1"
);
setIsQuery
(
"1"
);
setSort
(
2
);
}});
columns
.
add
(
new
GenTableColumn
(){{
setColumnName
(
"process_id"
);
setColumnComment
(
"工序ID"
);
setColumnId
(
3
l
);
setJavaType
(
"Long"
);
setJavaField
(
"processId"
);
setIsPk
(
"0"
);
setIsInsert
(
"1"
);
setIsEdit
(
"1"
);
setIsList
(
"1"
);
setIsQuery
(
"1"
);
setSort
(
3
);
}});
columns
.
add
(
new
GenTableColumn
(){{
setColumnName
(
"id"
);
setColumnComment
(
"ID"
);
setColumnId
(
4
l
);
setJavaType
(
"Long"
);
setJavaField
(
"id"
);
setIsPk
(
"1"
);
setIsInsert
(
"1"
);
setIsEdit
(
"0"
);
setIsList
(
"0"
);
setIsQuery
(
"0"
);
setSort
(
4
);
}});
columns
.
add
(
new
GenTableColumn
(){{
setColumnName
(
"start_time"
);
setColumnComment
(
"开始生产时间"
);
setColumnId
(
5
l
);
setJavaType
(
"Date"
);
setJavaField
(
"startTime"
);
setIsPk
(
"1"
);
setIsInsert
(
"1"
);
setIsEdit
(
"1"
);
setIsList
(
"1"
);
setIsQuery
(
"0"
);
setSort
(
5
);
}});
columns
.
add
(
new
GenTableColumn
(){{
setColumnName
(
"quantity_produced"
);
setColumnComment
(
"已生产数量"
);
setColumnId
(
6
l
);
setJavaType
(
"BigDecimal"
);
setJavaField
(
"quantityProduced"
);
setIsPk
(
"1"
);
setIsInsert
(
"1"
);
setIsEdit
(
"1"
);
setIsList
(
"1"
);
setIsQuery
(
"0"
);
setSort
(
6
);
}});
columns
.
add
(
new
GenTableColumn
(){{
setColumnName
(
"is_formal"
);
setColumnComment
(
"是否正式产品"
);
setColumnId
(
7
l
);
setJavaType
(
"Integer"
);
setJavaField
(
"isFormal"
);
setIsPk
(
"1"
);
setIsInsert
(
"1"
);
setIsEdit
(
"1"
);
setIsList
(
"1"
);
setIsQuery
(
"0"
);
setSort
(
7
);
}});
genTable
.
setColumns
(
columns
);
genTable
.
setTableName
(
"pro_bom"
);
genTable
.
setTableComment
(
"BOM表"
);
genTable
.
setClassName
(
"ProBom1"
);
genTable
.
setTplCategory
(
"crud"
);
genTable
.
setPackageName
(
"com.ximai.mes.md"
);
genTable
.
setModuleName
(
"md"
);
genTable
.
setBusinessName
(
"md.basic"
);
genTable
.
setFunctionName
(
"BOM"
);
genTable
.
setFunctionAuthor
(
"chicheng.li"
);
genTable
.
setGenPath
(
"/"
);
genTableService
.
generatorCode
(
genTable
);
}
}
mes/src/main/java/com/ximai/mes/face/sap/SapService.java
View file @
529b699c
...
@@ -15,9 +15,6 @@ import org.springframework.web.bind.annotation.PostMapping;
...
@@ -15,9 +15,6 @@ import org.springframework.web.bind.annotation.PostMapping;
contextId
=
"SapServiceClient"
contextId
=
"SapServiceClient"
)
)
public
interface
SapService
{
public
interface
SapService
{
//http://192.168.3.109:8000/sap/bc/erp_ep/bd_mastdata/material?sap-client=300
//密码 Bsn123456
//用户名 rest_user
/**
/**
* 根据字典编码(字段名)查询数据字典
* 根据字典编码(字段名)查询数据字典
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment