优化生成器模板:让生成的代码更简洁,流程相关代码默认不生成

优化生成模板:一对多代码生成(ERP模板)生成的子表实体ApiModel注释中value为附表名称 #2365
minio上传文件,文件名包含点的时候拼接文件名有问题 issues/I3CLFL
日志里把具体的文件加上吧 issues/I3BJDQ
This commit is contained in:
zhangdaiscott 2021-04-01 09:57:05 +08:00
parent 661804078c
commit 9d1428ab85
11 changed files with 55 additions and 8 deletions

View File

@ -75,7 +75,7 @@ public class MinioUtil {
orgName=file.getName(); orgName=file.getName();
} }
orgName = CommonUtils.getFileName(orgName); orgName = CommonUtils.getFileName(orgName);
String objectName = bizPath+"/"+orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf(".")); String objectName = bizPath+"/"+orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf("."));
// 使用putObject上传一个本地文件到存储桶中 // 使用putObject上传一个本地文件到存储桶中
if(objectName.startsWith("/")){ if(objectName.startsWith("/")){

View File

@ -111,7 +111,7 @@ public class OssBootUtil {
orgName=file.getName(); orgName=file.getName();
} }
orgName = CommonUtils.getFileName(orgName); orgName = CommonUtils.getFileName(orgName);
String fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf(".")); String fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf("."));
if (!fileDir.endsWith("/")) { if (!fileDir.endsWith("/")) {
fileDir = fileDir.concat("/"); fileDir = fileDir.concat("/");
} }

View File

@ -28,7 +28,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.net.URLDecoder; import java.net.URLDecoder;
/** /**
* <p> * <p>
* 用户表 前端控制器 * 用户表 前端控制器

View File

@ -21,7 +21,7 @@ import java.io.UnsupportedEncodingException;
* @Date: ${.now?string["yyyy-MM-dd"]} * @Date: ${.now?string["yyyy-MM-dd"]}
* @Version: V1.0 * @Version: V1.0
*/ */
@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}") @ApiModel(value="${subTab.tableName}对象", description="${subTab.ftlDescription}")
@Data @Data
@TableName("${subTab.tableName}") @TableName("${subTab.tableName}")
public class ${subTab.entityName} implements Serializable { public class ${subTab.entityName} implements Serializable {

View File

@ -8,6 +8,7 @@
<#assign form_popup = false> <#assign form_popup = false>
<#assign form_cat_tree = false> <#assign form_cat_tree = false>
<#assign form_cat_back = ""> <#assign form_cat_back = "">
<#assign bpm_flag=false>
<#assign form_span = 24> <#assign form_span = 24>
<#if tableVo.fieldRowNum==2> <#if tableVo.fieldRowNum==2>
<#assign form_span = 12> <#assign form_span = 12>
@ -17,6 +18,9 @@
<#assign form_span = 6> <#assign form_span = 6>
</#if> </#if>
<#list columns as po> <#list columns as po>
<#if po.fieldDbName=='bpm_status'>
<#assign bpm_flag=true>
</#if>
<#if po.isShow =='Y' && po.fieldName != 'id'> <#if po.isShow =='Y' && po.fieldName != 'id'>
<#assign form_field_dictCode=""> <#assign form_field_dictCode="">
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1> <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
@ -134,7 +138,9 @@
</#if> </#if>
</#list> </#list>
</a-tabs> </a-tabs>
<#if bpm_flag>
<a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row> <a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row>
</#if>
</a-spin> </a-spin>
</template> </template>
@ -379,6 +385,7 @@
} }
}, },
props: { props: {
<#if bpm_flag>
//流程表单data //流程表单data
formData: { formData: {
type: Object, type: Object,
@ -391,6 +398,7 @@
default: false, default: false,
required: false required: false
}, },
</#if>
//表单禁用 //表单禁用
disabled: { disabled: {
type: Boolean, type: Boolean,
@ -400,14 +408,17 @@
}, },
computed: { computed: {
formDisabled(){ formDisabled(){
<#if bpm_flag>
if(this.formBpm===true){ if(this.formBpm===true){
if(this.formData.disabled===false){ if(this.formData.disabled===false){
return false return false
} }
return true return true
} }
</#if>
return this.disabled return this.disabled
}, },
<#if bpm_flag>
showFlowSubmitButton(){ showFlowSubmitButton(){
if(this.formBpm===true){ if(this.formBpm===true){
if(this.formData.disabled===false){ if(this.formData.disabled===false){
@ -416,10 +427,13 @@
} }
return false return false
} }
</#if>
}, },
created () { created () {
<#if bpm_flag>
//如果是流程中表单则需要加载流程表单data //如果是流程中表单则需要加载流程表单data
this.showFlowData(); this.showFlowData();
</#if>
}, },
methods: { methods: {
addBefore(){ addBefore(){
@ -497,6 +511,7 @@
</#list> </#list>
} }
}, },
<#if bpm_flag>
//渲染流程表单数据 //渲染流程表单数据
showFlowData(){ showFlowData(){
if(this.formBpm === true){ if(this.formBpm === true){
@ -508,6 +523,7 @@
}) })
} }
}, },
</#if>
validateError(msg){ validateError(msg){
this.$message.error(msg) this.$message.error(msg)
}, },

View File

@ -24,7 +24,7 @@ import java.io.UnsupportedEncodingException;
*/ */
@Data @Data
@TableName("${subTab.tableName}") @TableName("${subTab.tableName}")
@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}") @ApiModel(value="${subTab.tableName}对象", description="${subTab.ftlDescription}")
public class ${subTab.entityName} implements Serializable { public class ${subTab.entityName} implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -22,7 +22,7 @@ import java.io.UnsupportedEncodingException;
* @Date: ${.now?string["yyyy-MM-dd"]} * @Date: ${.now?string["yyyy-MM-dd"]}
* @Version: V1.0 * @Version: V1.0
*/ */
@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}") @ApiModel(value="${subTab.tableName}对象", description="${subTab.ftlDescription}")
@Data @Data
@TableName("${subTab.tableName}") @TableName("${subTab.tableName}")
public class ${subTab.entityName} implements Serializable { public class ${subTab.entityName} implements Serializable {

View File

@ -8,8 +8,12 @@
<#assign form_popup = false> <#assign form_popup = false>
<#assign form_cat_tree = false> <#assign form_cat_tree = false>
<#assign form_cat_back = ""> <#assign form_cat_back = "">
<#assign bpm_flag=false>
<#assign form_span = 24> <#assign form_span = 24>
<#list columns as po> <#list columns as po>
<#if po.fieldDbName=='bpm_status'>
<#assign bpm_flag=true>
</#if>
<#if po.isShow =='Y' && po.fieldName != 'id'> <#if po.isShow =='Y' && po.fieldName != 'id'>
<#assign form_field_dictCode=""> <#assign form_field_dictCode="">
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1> <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
@ -125,7 +129,9 @@
</#if> </#if>
</#list> </#list>
</a-tabs> </a-tabs>
<#if bpm_flag>
<a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row> <a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row>
</#if>
</a-spin> </a-spin>
</template> </template>
@ -362,6 +368,7 @@
} }
}, },
props: { props: {
<#if bpm_flag>
//流程表单data //流程表单data
formData: { formData: {
type: Object, type: Object,
@ -374,6 +381,7 @@
default: false, default: false,
required: false required: false
}, },
</#if>
//表单禁用 //表单禁用
disabled: { disabled: {
type: Boolean, type: Boolean,
@ -383,14 +391,17 @@
}, },
computed: { computed: {
formDisabled(){ formDisabled(){
<#if bpm_flag>
if(this.formBpm===true){ if(this.formBpm===true){
if(this.formData.disabled===false){ if(this.formData.disabled===false){
return false return false
} }
return true return true
} }
</#if>
return this.disabled return this.disabled
}, },
<#if bpm_flag>
showFlowSubmitButton(){ showFlowSubmitButton(){
if(this.formBpm===true){ if(this.formBpm===true){
if(this.formData.disabled===false){ if(this.formData.disabled===false){
@ -399,10 +410,13 @@
} }
return false return false
} }
</#if>
}, },
created () { created () {
<#if bpm_flag>
//如果是流程中表单则需要加载流程表单data //如果是流程中表单则需要加载流程表单data
this.showFlowData(); this.showFlowData();
</#if>
}, },
methods: { methods: {
addBefore(){ addBefore(){
@ -475,6 +489,7 @@
</#list> </#list>
} }
}, },
<#if bpm_flag>
//渲染流程表单数据 //渲染流程表单数据
showFlowData(){ showFlowData(){
if(this.formBpm === true){ if(this.formBpm === true){
@ -486,6 +501,7 @@
}) })
} }
}, },
</#if>
validateError(msg){ validateError(msg){
this.$message.error(msg) this.$message.error(msg)
}, },

View File

@ -21,7 +21,7 @@ import java.io.UnsupportedEncodingException;
* @Date: ${.now?string["yyyy-MM-dd"]} * @Date: ${.now?string["yyyy-MM-dd"]}
* @Version: V1.0 * @Version: V1.0
*/ */
@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}") @ApiModel(value="${subTab.tableName}对象", description="${subTab.ftlDescription}")
@Data @Data
@TableName("${subTab.tableName}") @TableName("${subTab.tableName}")
public class ${subTab.entityName} implements Serializable { public class ${subTab.entityName} implements Serializable {

View File

@ -8,6 +8,7 @@
<#assign form_popup = false> <#assign form_popup = false>
<#assign form_cat_tree = false> <#assign form_cat_tree = false>
<#assign form_cat_back = ""> <#assign form_cat_back = "">
<#assign bpm_flag=false>
<#assign form_span = 24> <#assign form_span = 24>
<#if tableVo.fieldRowNum==2> <#if tableVo.fieldRowNum==2>
<#assign form_span = 12> <#assign form_span = 12>
@ -17,6 +18,9 @@
<#assign form_span = 6> <#assign form_span = 6>
</#if> </#if>
<#list columns as po> <#list columns as po>
<#if po.fieldDbName=='bpm_status'>
<#assign bpm_flag=true>
</#if>
<#if po.isShow =='Y' && po.fieldName != 'id'> <#if po.isShow =='Y' && po.fieldName != 'id'>
<#assign form_field_dictCode=""> <#assign form_field_dictCode="">
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1> <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
@ -134,7 +138,9 @@
</#if> </#if>
</#list> </#list>
</a-tabs> </a-tabs>
<#if bpm_flag>
<a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row> <a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row>
</#if>
</a-spin> </a-spin>
</template> </template>
@ -385,6 +391,7 @@
} }
}, },
props: { props: {
<#if bpm_flag>
//流程表单data //流程表单data
formData: { formData: {
type: Object, type: Object,
@ -397,6 +404,7 @@
default: false, default: false,
required: false required: false
}, },
</#if>
//表单禁用 //表单禁用
disabled: { disabled: {
type: Boolean, type: Boolean,
@ -406,14 +414,17 @@
}, },
computed: { computed: {
formDisabled(){ formDisabled(){
<#if bpm_flag>
if(this.formBpm===true){ if(this.formBpm===true){
if(this.formData.disabled===false){ if(this.formData.disabled===false){
return false return false
} }
return true return true
} }
</#if>
return this.disabled return this.disabled
}, },
<#if bpm_flag>
showFlowSubmitButton(){ showFlowSubmitButton(){
if(this.formBpm===true){ if(this.formBpm===true){
if(this.formData.disabled===false){ if(this.formData.disabled===false){
@ -422,10 +433,13 @@
} }
return false return false
} }
</#if>
}, },
created () { created () {
<#if bpm_flag>
//如果是流程中表单则需要加载流程表单data //如果是流程中表单则需要加载流程表单data
this.showFlowData(); this.showFlowData();
</#if>
}, },
methods: { methods: {
addBefore(){ addBefore(){
@ -503,6 +517,7 @@
</#list> </#list>
} }
}, },
<#if bpm_flag>
//渲染流程表单数据 //渲染流程表单数据
showFlowData(){ showFlowData(){
if(this.formBpm === true){ if(this.formBpm === true){
@ -514,6 +529,7 @@
}) })
} }
}, },
</#if>
validateError(msg){ validateError(msg){
this.$message.error(msg) this.$message.error(msg)
}, },

View File

@ -21,7 +21,7 @@ import java.io.UnsupportedEncodingException;
* @Date: ${.now?string["yyyy-MM-dd"]} * @Date: ${.now?string["yyyy-MM-dd"]}
* @Version: V1.0 * @Version: V1.0
*/ */
@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}") @ApiModel(value="${subTab.tableName}对象", description="${subTab.ftlDescription}")
@Data @Data
@TableName("${subTab.tableName}") @TableName("${subTab.tableName}")
public class ${subTab.entityName} implements Serializable { public class ${subTab.entityName} implements Serializable {