模板修改
This commit is contained in:
parent
9436d7cd19
commit
98f667ce3e
|
|
@ -87,8 +87,8 @@ spring:
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
# host: 114.215.82.135
|
# host: 114.215.82.135
|
||||||
# host: 127.0.0.1
|
host: 127.0.0.1
|
||||||
host: 13.70.28.14
|
# host: 13.70.28.14
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 密码
|
# 密码
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ import org.springframework.validation.annotation.Validated;
|
||||||
@Api(value = "${functionName}管理",tags = "${functionName}管理")
|
@Api(value = "${functionName}管理",tags = "${functionName}管理")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/${moduleName}/${businessName}")
|
@RequestMapping("/${moduleName}/${businessName}")
|
||||||
public class ${ClassName}Controller extends HcyBaseController {
|
public class ${ClassName}Controller extends EBTSController {
|
||||||
protected final Logger logger = LoggerFactory.getLogger(${ClassName}Controller.class);
|
protected final Logger logger = LoggerFactory.getLogger(${ClassName}Controller.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -57,7 +57,7 @@ public class ${ClassName}Controller extends HcyBaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation("查询${functionName}列表")
|
@ApiOperation("查询${functionName}列表")
|
||||||
@PreAuthorize("@ebts.hasPermi('${permissionPrefix}:list')")
|
@PreAuthorize("@ebts.hasPermi('${permissionPrefix}:list')")
|
||||||
@PutMapping("/list")
|
@PostMapping("/list")
|
||||||
public Serializable list(@Validated @RequestBody ${ClassName} ${className}) {
|
public Serializable list(@Validated @RequestBody ${ClassName} ${className}) {
|
||||||
try {
|
try {
|
||||||
startPage(${className}.getPageInfo());
|
startPage(${className}.getPageInfo());
|
||||||
|
|
@ -83,7 +83,7 @@ public class ${ClassName}Controller extends HcyBaseController {
|
||||||
@ApiOperation("导出${functionName}列表")
|
@ApiOperation("导出${functionName}列表")
|
||||||
@PreAuthorize("@ebts.hasPermi('${permissionPrefix}:export')")
|
@PreAuthorize("@ebts.hasPermi('${permissionPrefix}:export')")
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
||||||
@PutMapping("/export")
|
@PostMapping("/export")
|
||||||
public AjaxResult export(@Validated @RequestBody ${ClassName} ${className}) {
|
public AjaxResult export(@Validated @RequestBody ${ClassName} ${className}) {
|
||||||
try {
|
try {
|
||||||
ServerResult<List<${ClassName}>> genServerResult = ${className}Service.select${ClassName}List(${className});
|
ServerResult<List<${ClassName}>> genServerResult = ${className}Service.select${ClassName}List(${className});
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ import com.ebts.common.core.entity.${Entity};
|
||||||
import com.ebts.common.annotation.Excel;
|
import com.ebts.common.annotation.Excel;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${functionName}对象 ${tableName}
|
* ${functionName}对象 ${tableName}
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,9 @@ public class ${ClassName}ServiceImpl implements ${ClassName}Service {
|
||||||
try {
|
try {
|
||||||
${ClassName} ${className} = ${className}Dao.select${ClassName}ById(${pkColumn.javaField});
|
${ClassName} ${className} = ${className}Dao.select${ClassName}ById(${pkColumn.javaField});
|
||||||
if (${className} != null){
|
if (${className} != null){
|
||||||
return new ServerResult<${ClassName}>(true,${className});
|
return new ServerResult<>(true,${className});
|
||||||
}else {
|
}else {
|
||||||
return new ServerResult<${ClassName}>(false, ReturnConstants.RESULT_EMPTY);
|
return new ServerResult<>(false, ReturnConstants.RESULT_EMPTY);
|
||||||
}
|
}
|
||||||
}catch (RuntimeException e){
|
}catch (RuntimeException e){
|
||||||
logger.error(e.getMessage());
|
logger.error(e.getMessage());
|
||||||
|
|
@ -71,13 +71,13 @@ public class ${ClassName}ServiceImpl implements ${ClassName}Service {
|
||||||
try {
|
try {
|
||||||
List<${ClassName}> ${className}List = ${className}Dao.select${ClassName}List(${className});
|
List<${ClassName}> ${className}List = ${className}Dao.select${ClassName}List(${className});
|
||||||
if (${className}List.size()>0){
|
if (${className}List.size()>0){
|
||||||
return new ServerResult<List<${ClassName}>>(true,${className}List);
|
return new ServerResult<>(true,${className}List);
|
||||||
}else {
|
}else {
|
||||||
return new ServerResult<List<${ClassName}>>(false,ReturnConstants.RESULT_EMPTY);
|
return new ServerResult<>(false,ReturnConstants.RESULT_EMPTY);
|
||||||
}
|
}
|
||||||
}catch (RuntimeException e){
|
}catch (RuntimeException e){
|
||||||
logger.error(e.getMessage());
|
logger.error(e.getMessage());
|
||||||
return new ServerResult<List<${ClassName}>>(false,ReturnConstants.DB_EX);
|
return new ServerResult<>(false,ReturnConstants.DB_EX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import request from '@/utils/request'
|
||||||
export function list${BusinessName}(data) {
|
export function list${BusinessName}(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/${moduleName}/${businessName}/list',
|
url: '/${moduleName}/${businessName}/list',
|
||||||
method: 'put',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -14,7 +14,7 @@ export function list${BusinessName}(data) {
|
||||||
export function export${BusinessName}(data) {
|
export function export${BusinessName}(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/${moduleName}/${businessName}/export',
|
url: '/${moduleName}/${businessName}/export',
|
||||||
method: 'put',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -183,6 +183,11 @@
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="序号" type="index" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ ((queryParams.pageInfo.pageNum - 1) * queryParams.pageInfo.pageSize + scope.$index + 1)}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#set($javaField=$column.javaField)
|
#set($javaField=$column.javaField)
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||||
|
|
@ -191,7 +196,7 @@
|
||||||
#else
|
#else
|
||||||
#set($comment=$column.columnComment)
|
#set($comment=$column.columnComment)
|
||||||
#end
|
#end
|
||||||
#if($column.pk)
|
#if($column.pk && "" != $column.pk)
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" />
|
<el-table-column label="${comment}" align="center" prop="${javaField}" />
|
||||||
#elseif($column.list && $column.htmlType == "datetime")
|
#elseif($column.list && $column.htmlType == "datetime")
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
|
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
|
||||||
|
|
@ -252,8 +257,8 @@
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.params.pageNum"
|
:page.sync="queryParams.pageInfo.pageNum"
|
||||||
:limit.sync="queryParams.params.pageSize"
|
:limit.sync="queryParams.pageInfo.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue