Commit 9d1428ab85cd1b2f385f3e7a3b622bd0f859c63d

Authored by zhangdaiscott
1 parent 66180407

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

优化生成模板:一对多代码生成(ERP模板)生成的子表实体ApiModel注释中value为附表名称 #2365
minio上传文件,文件名包含点的时候拼接文件名有问题 issues/I3CLFL
日志里把具体的文件加上吧 issues/I3BJDQ
Showing 11 changed files with 55 additions and 8 deletions
jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/MinioUtil.java
@@ -75,7 +75,7 @@ public class MinioUtil { @@ -75,7 +75,7 @@ public class MinioUtil {
75 orgName=file.getName(); 75 orgName=file.getName();
76 } 76 }
77 orgName = CommonUtils.getFileName(orgName); 77 orgName = CommonUtils.getFileName(orgName);
78 - String objectName = bizPath+"/"+orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf(".")); 78 + String objectName = bizPath+"/"+orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf("."));
79 79
80 // 使用putObject上传一个本地文件到存储桶中。 80 // 使用putObject上传一个本地文件到存储桶中。
81 if(objectName.startsWith("/")){ 81 if(objectName.startsWith("/")){
jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oss/OssBootUtil.java
@@ -111,7 +111,7 @@ public class OssBootUtil { @@ -111,7 +111,7 @@ public class OssBootUtil {
111 orgName=file.getName(); 111 orgName=file.getName();
112 } 112 }
113 orgName = CommonUtils.getFileName(orgName); 113 orgName = CommonUtils.getFileName(orgName);
114 - String fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf(".")); 114 + String fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.lastIndexOf("."));
115 if (!fileDir.endsWith("/")) { 115 if (!fileDir.endsWith("/")) {
116 fileDir = fileDir.concat("/"); 116 fileDir = fileDir.concat("/");
117 } 117 }
jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/CommonController.java
@@ -28,7 +28,6 @@ import javax.servlet.http.HttpServletRequest; @@ -28,7 +28,6 @@ import javax.servlet.http.HttpServletRequest;
28 import javax.servlet.http.HttpServletResponse; 28 import javax.servlet.http.HttpServletResponse;
29 import java.io.*; 29 import java.io.*;
30 import java.net.URLDecoder; 30 import java.net.URLDecoder;
31 -  
32 /** 31 /**
33 * <p> 32 * <p>
34 * 用户表 前端控制器 33 * 用户表 前端控制器
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
@@ -21,7 +21,7 @@ import java.io.UnsupportedEncodingException; @@ -21,7 +21,7 @@ import java.io.UnsupportedEncodingException;
21 * @Date: ${.now?string["yyyy-MM-dd"]} 21 * @Date: ${.now?string["yyyy-MM-dd"]}
22 * @Version: V1.0 22 * @Version: V1.0
23 */ 23 */
24 -@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}") 24 +@ApiModel(value="${subTab.tableName}对象", description="${subTab.ftlDescription}")
25 @Data 25 @Data
26 @TableName("${subTab.tableName}") 26 @TableName("${subTab.tableName}")
27 public class ${subTab.entityName} implements Serializable { 27 public class ${subTab.entityName} implements Serializable {
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/default/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 <#assign form_popup = false> 8 <#assign form_popup = false>
9 <#assign form_cat_tree = false> 9 <#assign form_cat_tree = false>
10 <#assign form_cat_back = ""> 10 <#assign form_cat_back = "">
  11 +<#assign bpm_flag=false>
11 <#assign form_span = 24> 12 <#assign form_span = 24>
12 <#if tableVo.fieldRowNum==2> 13 <#if tableVo.fieldRowNum==2>
13 <#assign form_span = 12> 14 <#assign form_span = 12>
@@ -17,6 +18,9 @@ @@ -17,6 +18,9 @@
17 <#assign form_span = 6> 18 <#assign form_span = 6>
18 </#if> 19 </#if>
19 <#list columns as po> 20 <#list columns as po>
  21 +<#if po.fieldDbName=='bpm_status'>
  22 + <#assign bpm_flag=true>
  23 +</#if>
20 <#if po.isShow =='Y' && po.fieldName != 'id'> 24 <#if po.isShow =='Y' && po.fieldName != 'id'>
21 <#assign form_field_dictCode=""> 25 <#assign form_field_dictCode="">
22 <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1> 26 <#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 @@ @@ -134,7 +138,9 @@
134 </#if> 138 </#if>
135 </#list> 139 </#list>
136 </a-tabs> 140 </a-tabs>
  141 + <#if bpm_flag>
137 <a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row> 142 <a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row>
  143 + </#if>
138 </a-spin> 144 </a-spin>
139 </template> 145 </template>
140 146
@@ -379,6 +385,7 @@ @@ -379,6 +385,7 @@
379 } 385 }
380 }, 386 },
381 props: { 387 props: {
  388 + <#if bpm_flag>
382 //流程表单data 389 //流程表单data
383 formData: { 390 formData: {
384 type: Object, 391 type: Object,
@@ -391,6 +398,7 @@ @@ -391,6 +398,7 @@
391 default: false, 398 default: false,
392 required: false 399 required: false
393 }, 400 },
  401 + </#if>
394 //表单禁用 402 //表单禁用
395 disabled: { 403 disabled: {
396 type: Boolean, 404 type: Boolean,
@@ -400,14 +408,17 @@ @@ -400,14 +408,17 @@
400 }, 408 },
401 computed: { 409 computed: {
402 formDisabled(){ 410 formDisabled(){
  411 + <#if bpm_flag>
403 if(this.formBpm===true){ 412 if(this.formBpm===true){
404 if(this.formData.disabled===false){ 413 if(this.formData.disabled===false){
405 return false 414 return false
406 } 415 }
407 return true 416 return true
408 } 417 }
  418 + </#if>
409 return this.disabled 419 return this.disabled
410 }, 420 },
  421 + <#if bpm_flag>
411 showFlowSubmitButton(){ 422 showFlowSubmitButton(){
412 if(this.formBpm===true){ 423 if(this.formBpm===true){
413 if(this.formData.disabled===false){ 424 if(this.formData.disabled===false){
@@ -416,10 +427,13 @@ @@ -416,10 +427,13 @@
416 } 427 }
417 return false 428 return false
418 } 429 }
  430 + </#if>
419 }, 431 },
420 created () { 432 created () {
  433 + <#if bpm_flag>
421 //如果是流程中表单,则需要加载流程表单data 434 //如果是流程中表单,则需要加载流程表单data
422 this.showFlowData(); 435 this.showFlowData();
  436 + </#if>
423 }, 437 },
424 methods: { 438 methods: {
425 addBefore(){ 439 addBefore(){
@@ -497,6 +511,7 @@ @@ -497,6 +511,7 @@
497 </#list> 511 </#list>
498 } 512 }
499 }, 513 },
  514 + <#if bpm_flag>
500 //渲染流程表单数据 515 //渲染流程表单数据
501 showFlowData(){ 516 showFlowData(){
502 if(this.formBpm === true){ 517 if(this.formBpm === true){
@@ -508,6 +523,7 @@ @@ -508,6 +523,7 @@
508 }) 523 })
509 } 524 }
510 }, 525 },
  526 + </#if>
511 validateError(msg){ 527 validateError(msg){
512 this.$message.error(msg) 528 this.$message.error(msg)
513 }, 529 },
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/erp/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
@@ -24,7 +24,7 @@ import java.io.UnsupportedEncodingException; @@ -24,7 +24,7 @@ import java.io.UnsupportedEncodingException;
24 */ 24 */
25 @Data 25 @Data
26 @TableName("${subTab.tableName}") 26 @TableName("${subTab.tableName}")
27 -@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}") 27 +@ApiModel(value="${subTab.tableName}对象", description="${subTab.ftlDescription}")
28 public class ${subTab.entityName} implements Serializable { 28 public class ${subTab.entityName} implements Serializable {
29 private static final long serialVersionUID = 1L; 29 private static final long serialVersionUID = 1L;
30 30
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
@@ -22,7 +22,7 @@ import java.io.UnsupportedEncodingException; @@ -22,7 +22,7 @@ import java.io.UnsupportedEncodingException;
22 * @Date: ${.now?string["yyyy-MM-dd"]} 22 * @Date: ${.now?string["yyyy-MM-dd"]}
23 * @Version: V1.0 23 * @Version: V1.0
24 */ 24 */
25 -@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}") 25 +@ApiModel(value="${subTab.tableName}对象", description="${subTab.ftlDescription}")
26 @Data 26 @Data
27 @TableName("${subTab.tableName}") 27 @TableName("${subTab.tableName}")
28 public class ${subTab.entityName} implements Serializable { 28 public class ${subTab.entityName} implements Serializable {
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/inner-table/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei
@@ -8,8 +8,12 @@ @@ -8,8 +8,12 @@
8 <#assign form_popup = false> 8 <#assign form_popup = false>
9 <#assign form_cat_tree = false> 9 <#assign form_cat_tree = false>
10 <#assign form_cat_back = ""> 10 <#assign form_cat_back = "">
  11 +<#assign bpm_flag=false>
11 <#assign form_span = 24> 12 <#assign form_span = 24>
12 <#list columns as po> 13 <#list columns as po>
  14 +<#if po.fieldDbName=='bpm_status'>
  15 + <#assign bpm_flag=true>
  16 +</#if>
13 <#if po.isShow =='Y' && po.fieldName != 'id'> 17 <#if po.isShow =='Y' && po.fieldName != 'id'>
14 <#assign form_field_dictCode=""> 18 <#assign form_field_dictCode="">
15 <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1> 19 <#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 @@ @@ -125,7 +129,9 @@
125 </#if> 129 </#if>
126 </#list> 130 </#list>
127 </a-tabs> 131 </a-tabs>
  132 + <#if bpm_flag>
128 <a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row> 133 <a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row>
  134 + </#if>
129 </a-spin> 135 </a-spin>
130 </template> 136 </template>
131 137
@@ -362,6 +368,7 @@ @@ -362,6 +368,7 @@
362 } 368 }
363 }, 369 },
364 props: { 370 props: {
  371 + <#if bpm_flag>
365 //流程表单data 372 //流程表单data
366 formData: { 373 formData: {
367 type: Object, 374 type: Object,
@@ -374,6 +381,7 @@ @@ -374,6 +381,7 @@
374 default: false, 381 default: false,
375 required: false 382 required: false
376 }, 383 },
  384 + </#if>
377 //表单禁用 385 //表单禁用
378 disabled: { 386 disabled: {
379 type: Boolean, 387 type: Boolean,
@@ -383,14 +391,17 @@ @@ -383,14 +391,17 @@
383 }, 391 },
384 computed: { 392 computed: {
385 formDisabled(){ 393 formDisabled(){
  394 + <#if bpm_flag>
386 if(this.formBpm===true){ 395 if(this.formBpm===true){
387 if(this.formData.disabled===false){ 396 if(this.formData.disabled===false){
388 return false 397 return false
389 } 398 }
390 return true 399 return true
391 } 400 }
  401 + </#if>
392 return this.disabled 402 return this.disabled
393 }, 403 },
  404 + <#if bpm_flag>
394 showFlowSubmitButton(){ 405 showFlowSubmitButton(){
395 if(this.formBpm===true){ 406 if(this.formBpm===true){
396 if(this.formData.disabled===false){ 407 if(this.formData.disabled===false){
@@ -399,10 +410,13 @@ @@ -399,10 +410,13 @@
399 } 410 }
400 return false 411 return false
401 } 412 }
  413 + </#if>
402 }, 414 },
403 created () { 415 created () {
  416 + <#if bpm_flag>
404 //如果是流程中表单,则需要加载流程表单data 417 //如果是流程中表单,则需要加载流程表单data
405 this.showFlowData(); 418 this.showFlowData();
  419 + </#if>
406 }, 420 },
407 methods: { 421 methods: {
408 addBefore(){ 422 addBefore(){
@@ -475,6 +489,7 @@ @@ -475,6 +489,7 @@
475 </#list> 489 </#list>
476 } 490 }
477 }, 491 },
  492 + <#if bpm_flag>
478 //渲染流程表单数据 493 //渲染流程表单数据
479 showFlowData(){ 494 showFlowData(){
480 if(this.formBpm === true){ 495 if(this.formBpm === true){
@@ -486,6 +501,7 @@ @@ -486,6 +501,7 @@
486 }) 501 })
487 } 502 }
488 }, 503 },
  504 + </#if>
489 validateError(msg){ 505 validateError(msg){
490 this.$message.error(msg) 506 this.$message.error(msg)
491 }, 507 },
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
@@ -21,7 +21,7 @@ import java.io.UnsupportedEncodingException; @@ -21,7 +21,7 @@ import java.io.UnsupportedEncodingException;
21 * @Date: ${.now?string["yyyy-MM-dd"]} 21 * @Date: ${.now?string["yyyy-MM-dd"]}
22 * @Version: V1.0 22 * @Version: V1.0
23 */ 23 */
24 -@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}") 24 +@ApiModel(value="${subTab.tableName}对象", description="${subTab.ftlDescription}")
25 @Data 25 @Data
26 @TableName("${subTab.tableName}") 26 @TableName("${subTab.tableName}")
27 public class ${subTab.entityName} implements Serializable { 27 public class ${subTab.entityName} implements Serializable {
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/jvxe/onetomany/java/${bussiPackage}/${entityPackage}/vue/modules/${entityName}Form.vuei
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 <#assign form_popup = false> 8 <#assign form_popup = false>
9 <#assign form_cat_tree = false> 9 <#assign form_cat_tree = false>
10 <#assign form_cat_back = ""> 10 <#assign form_cat_back = "">
  11 +<#assign bpm_flag=false>
11 <#assign form_span = 24> 12 <#assign form_span = 24>
12 <#if tableVo.fieldRowNum==2> 13 <#if tableVo.fieldRowNum==2>
13 <#assign form_span = 12> 14 <#assign form_span = 12>
@@ -17,6 +18,9 @@ @@ -17,6 +18,9 @@
17 <#assign form_span = 6> 18 <#assign form_span = 6>
18 </#if> 19 </#if>
19 <#list columns as po> 20 <#list columns as po>
  21 +<#if po.fieldDbName=='bpm_status'>
  22 + <#assign bpm_flag=true>
  23 +</#if>
20 <#if po.isShow =='Y' && po.fieldName != 'id'> 24 <#if po.isShow =='Y' && po.fieldName != 'id'>
21 <#assign form_field_dictCode=""> 25 <#assign form_field_dictCode="">
22 <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1> 26 <#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 @@ @@ -134,7 +138,9 @@
134 </#if> 138 </#if>
135 </#list> 139 </#list>
136 </a-tabs> 140 </a-tabs>
  141 + <#if bpm_flag>
137 <a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row> 142 <a-row v-if="showFlowSubmitButton" style="text-align: center;width: 100%;margin-top: 16px;"><a-button @click="handleOk">提 交</a-button></a-row>
  143 + </#if>
138 </a-spin> 144 </a-spin>
139 </template> 145 </template>
140 146
@@ -385,6 +391,7 @@ @@ -385,6 +391,7 @@
385 } 391 }
386 }, 392 },
387 props: { 393 props: {
  394 + <#if bpm_flag>
388 //流程表单data 395 //流程表单data
389 formData: { 396 formData: {
390 type: Object, 397 type: Object,
@@ -397,6 +404,7 @@ @@ -397,6 +404,7 @@
397 default: false, 404 default: false,
398 required: false 405 required: false
399 }, 406 },
  407 + </#if>
400 //表单禁用 408 //表单禁用
401 disabled: { 409 disabled: {
402 type: Boolean, 410 type: Boolean,
@@ -406,14 +414,17 @@ @@ -406,14 +414,17 @@
406 }, 414 },
407 computed: { 415 computed: {
408 formDisabled(){ 416 formDisabled(){
  417 + <#if bpm_flag>
409 if(this.formBpm===true){ 418 if(this.formBpm===true){
410 if(this.formData.disabled===false){ 419 if(this.formData.disabled===false){
411 return false 420 return false
412 } 421 }
413 return true 422 return true
414 } 423 }
  424 + </#if>
415 return this.disabled 425 return this.disabled
416 }, 426 },
  427 + <#if bpm_flag>
417 showFlowSubmitButton(){ 428 showFlowSubmitButton(){
418 if(this.formBpm===true){ 429 if(this.formBpm===true){
419 if(this.formData.disabled===false){ 430 if(this.formData.disabled===false){
@@ -422,10 +433,13 @@ @@ -422,10 +433,13 @@
422 } 433 }
423 return false 434 return false
424 } 435 }
  436 + </#if>
425 }, 437 },
426 created () { 438 created () {
  439 + <#if bpm_flag>
427 //如果是流程中表单,则需要加载流程表单data 440 //如果是流程中表单,则需要加载流程表单data
428 this.showFlowData(); 441 this.showFlowData();
  442 + </#if>
429 }, 443 },
430 methods: { 444 methods: {
431 addBefore(){ 445 addBefore(){
@@ -503,6 +517,7 @@ @@ -503,6 +517,7 @@
503 </#list> 517 </#list>
504 } 518 }
505 }, 519 },
  520 + <#if bpm_flag>
506 //渲染流程表单数据 521 //渲染流程表单数据
507 showFlowData(){ 522 showFlowData(){
508 if(this.formBpm === true){ 523 if(this.formBpm === true){
@@ -514,6 +529,7 @@ @@ -514,6 +529,7 @@
514 }) 529 })
515 } 530 }
516 }, 531 },
  532 + </#if>
517 validateError(msg){ 533 validateError(msg){
518 this.$message.error(msg) 534 this.$message.error(msg)
519 }, 535 },
jeecg-boot/jeecg-boot-module-system/src/main/resources/jeecg/code-template-online/tab/onetomany/java/${bussiPackage}/${entityPackage}/entity/[1-n]Entity.javai
@@ -21,7 +21,7 @@ import java.io.UnsupportedEncodingException; @@ -21,7 +21,7 @@ import java.io.UnsupportedEncodingException;
21 * @Date: ${.now?string["yyyy-MM-dd"]} 21 * @Date: ${.now?string["yyyy-MM-dd"]}
22 * @Version: V1.0 22 * @Version: V1.0
23 */ 23 */
24 -@ApiModel(value="${tableName}对象", description="${tableVo.ftlDescription}") 24 +@ApiModel(value="${subTab.tableName}对象", description="${subTab.ftlDescription}")
25 @Data 25 @Data
26 @TableName("${subTab.tableName}") 26 @TableName("${subTab.tableName}")
27 public class ${subTab.entityName} implements Serializable { 27 public class ${subTab.entityName} implements Serializable {