提交 1d06780b 编写于 作者: sq3536's avatar sq3536

列重复bug

上级 325c7698
......@@ -94,6 +94,14 @@ public class VoFieldModel extends BaseModel {
private String javaType;
private boolean singleFile=false;
private boolean fileList=false;
private boolean singleDict=false;
private boolean dictList=false;
public String getJavaType()
{
if(javaType==null)
......@@ -105,6 +113,7 @@ public class VoFieldModel extends BaseModel {
javaType = javaType + ".LIST";
formatShape="STRING";
serializeUsing="com.alibaba.fastjson.serializer.ToStringSerializer.class";
dictList=true;
}
else {
javaType = javaType + ".ENUM";
......@@ -112,16 +121,19 @@ public class VoFieldModel extends BaseModel {
formatShape="NUMBER";
else
formatShape="STRING";
singleDict=true;
}
}
else if(this.getPSEditor()!=null&&(this.getPSDEFormItem() instanceof IPSFileUploader||"FILEUPLOADER".equals(this.getPSEditor().getEditorType())))
{
javaType = "List<FileDto>";
fileList=true;
}
else if(this.getPSEditor()!=null&&("hfh".equals(this.getPSEditor().getEditorStyle())||"zp".equals(this.getPSEditor().getEditorStyle())))
{
javaType = "FileDto";
serializeUsing="com.alibaba.fastjson.serializer.ToStringSerializer.class";
singleFile=true;
}
}
return javaType;
......
......@@ -101,6 +101,8 @@ public class {{pascalCase dict.codeName}}Dict {
@JsonCreator
@JSONCreator
public static LIST form(Object tags) {
if(tags==null)
return null;
LIST list=new LIST();
Arrays.asList(tags.toString().split(";|,")).forEach(tag->{
ENUM item=ENUM.from(tag);
......
......@@ -13,7 +13,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
......@@ -30,6 +32,7 @@ import {{packageName}}.api.{{apps}}.dict.*;
* {{ctrl.appEntity.entity.logicName}}AddDTO对象[{{ctrl.codeName}}]{{replace ctrl.logicName "表单" ""}}
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
@ApiModel(value = "{{ctrl.apiModelName}}AddDto", description = "{{ctrl.appEntity.entity.logicName}}-{{pascalCase ctrl.codeName}}AddDto-{{replace ctrl.logicName "表单" ""}}")
public class {{pascalCase ctrl.codeName}}AddDto extends {{pascalCase ctrl.codeName}}BaseDto {
......
......@@ -13,7 +13,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
......@@ -31,6 +33,7 @@ import {{packageName}}.api.{{apps}}.dict.*;
* {{ctrl.appEntity.entity.logicName}}BaseDTO对象[{{ctrl.codeName}}]{{replace ctrl.logicName "表单" ""}}
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
@ApiModel(value = "{{ctrl.apiModelName}}BaseDto", description = "{{ctrl.appEntity.entity.logicName}}-{{pascalCase ctrl.codeName}}BaseDto-{{replace ctrl.logicName "表单" ""}}")
public class {{pascalCase ctrl.codeName}}BaseDto implements Serializable {
......@@ -55,6 +58,26 @@ public class {{pascalCase ctrl.codeName}}BaseDto implements Serializable {
{{/eq}}
@ApiModelProperty(value = "{{logicName}}{{#if userTag}}{{userTag}}{{/if}}{{#if dict}}{{#unless singleSelect}}多选{{/unless}}【字典:{{dict.name}}{{/if}}{{#if timeType}},格式:{{format}}{{/if}}", position = {{position}}{{#if timeType}}, notes = "格式:{{format}}"{{/if}}{{#if dict}}, notes = "字典:{{dict.name}}", dataType = "{{lowerCase type.java}}", reference = "{{dictCodeName}}"{{/if}}{{#if required}}, required = true{{/if}}{{#if hidden}}, hidden = true{{/if}}{{#if example}}, example = "{{example}}"{{/if}})
protected {{javaType}} {{camelCase codeName}};
{{#if dictList}}
public void set{{pascalCase codeName}}(String {{camelCase codeName}}) {
this.{{camelCase codeName}} = {{javaType}}.form({{camelCase codeName}});
}
{{/if}}
{{#if singleFile}}
public void set{{pascalCase codeName}}(String {{camelCase codeName}}) {
if({{camelCase codeName}}==null)
return;
FileDto fileDto = new FileDto({{camelCase codeName}},null,null);
this.{{camelCase codeName}} = fileDto;
}
{{/if}}
{{#if fileList}}
public void set{{pascalCase codeName}}(String {{camelCase codeName}}) {
if({{camelCase codeName}}==null)
return;
this.{{camelCase codeName}} = JSON.parseArray({{camelCase codeName}},FileDto.class);
}
{{/if}}
{{/unless}}
{{/each}}
......
......@@ -13,7 +13,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
......@@ -30,6 +32,7 @@ import {{packageName}}.api.{{apps}}.dict.*;
* {{ctrl.appEntity.entity.logicName}}DTO对象[{{ctrl.codeName}}]{{replace ctrl.logicName "表单" ""}}
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
@ApiModel(value = "{{ctrl.apiModelName}}Dto", description = "{{ctrl.appEntity.entity.logicName}}-{{pascalCase ctrl.codeName}}Dto-{{replace ctrl.logicName "表单" ""}}")
public class {{pascalCase ctrl.codeName}}Dto extends {{pascalCase ctrl.codeName}}BaseDto {
......
......@@ -13,7 +13,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
......@@ -30,6 +32,7 @@ import {{packageName}}.api.{{apps}}.dict.*;
* {{ctrl.appEntity.entity.logicName}}UpdateDTO对象[{{ctrl.codeName}}]{{replace ctrl.logicName "表单" ""}}
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
@ApiModel(value = "{{ctrl.apiModelName}}UpdateDto", description = "{{ctrl.appEntity.entity.logicName}}-{{pascalCase ctrl.codeName}}UpdateDto-{{replace ctrl.logicName "表单" ""}}")
public class {{pascalCase ctrl.codeName}}UpdateDto extends {{pascalCase ctrl.codeName}}BaseDto {
......
......@@ -44,9 +44,9 @@
where
{{#if entity.logicValid}}
{{#if entity.logicValidField.type.number}}
{{entity.logicValidField.columnName}} = {{entity.validLogicValue}}
t1.{{entity.logicValidField.columnName}} = {{entity.validLogicValue}}
{{else}}
{{entity.logicValidField.columnName}} = '{{entity.validLogicValue}}'
t1.{{entity.logicValidField.columnName}} = '{{entity.validLogicValue}}'
{{/if}}
and
{{/if}}
......@@ -67,14 +67,14 @@
where
{{#if entity.logicValid}}
{{#if entity.logicValidField.type.number}}
{{entity.logicValidField.columnName}} = {{entity.validLogicValue}}
t1.{{entity.logicValidField.columnName}} = {{entity.validLogicValue}}
{{else}}
{{entity.logicValidField.columnName}} = '{{entity.validLogicValue}}'
t1.{{entity.logicValidField.columnName}} = '{{entity.validLogicValue}}'
{{/if}}
and
{{/if}}
{{/if}}
({{#each entity.keyFields as |field|}}{{#unless @first}} and {{/unless}}{{field.columnName}} = #{ {{camelCase field.codeName}} }{{/each}})
({{#each entity.keyFields as |field|}}{{#unless @first}} and {{/unless}}t1.{{field.columnName}} = #{ {{camelCase field.codeName}} }{{/each}})
</select>
<select id="selectEntities" parameterType="java.util.List" resultMap="{{entity.codeName}}ResultMap">
......@@ -90,14 +90,14 @@
where
{{#if entity.logicValid}}
{{#if entity.logicValidField.type.number}}
{{entity.logicValidField.columnName}} = {{entity.validLogicValue}}
t1.{{entity.logicValidField.columnName}} = {{entity.validLogicValue}}
{{else}}
{{entity.logicValidField.columnName}} = '{{entity.validLogicValue}}'
t1.{{entity.logicValidField.columnName}} = '{{entity.validLogicValue}}'
{{/if}}
and
{{/if}}
{{/if}}
({{#each entity.keyFields as |field|}}{{#unless @first}},{{/unless}}{{field.columnName}}{{/each}})
({{#each entity.keyFields as |field|}}{{#unless @first}},{{/unless}}t1.{{field.columnName}}{{/each}})
in (<foreach collection="list" item="item" index="index" separator=","> ({{#each entity.keyFields as |field|}}{{#unless @first}},{{/unless}}#{ item.{{camelCase field.codeName}} }{{/each}}) </foreach>)
</select>
......
......@@ -44,9 +44,9 @@
where
{{#if entity.logicValid}}
{{#if entity.logicValidField.type.number}}
{{entity.logicValidField.columnName}} = {{entity.validLogicValue}}
t1.{{entity.logicValidField.columnName}} = {{entity.validLogicValue}}
{{else}}
{{entity.logicValidField.columnName}} = '{{entity.validLogicValue}}'
t1.{{entity.logicValidField.columnName}} = '{{entity.validLogicValue}}'
{{/if}}
and
{{/if}}
......@@ -67,14 +67,14 @@
where
{{#if entity.logicValid}}
{{#if entity.logicValidField.type.number}}
{{entity.logicValidField.columnName}} = {{entity.validLogicValue}}
t1.{{entity.logicValidField.columnName}} = {{entity.validLogicValue}}
{{else}}
{{entity.logicValidField.columnName}} = '{{entity.validLogicValue}}'
t1.{{entity.logicValidField.columnName}} = '{{entity.validLogicValue}}'
{{/if}}
and
{{/if}}
{{/if}}
({{#each entity.keyFields as |field|}}{{#unless @first}} and {{/unless}}{{field.columnName}} = #{ {{camelCase field.codeName}} }{{/each}})
({{#each entity.keyFields as |field|}}{{#unless @first}} and {{/unless}}t1.{{field.columnName}} = #{ {{camelCase field.codeName}} }{{/each}})
</select>
<select id="selectEntities" parameterType="java.util.List" resultMap="{{entity.codeName}}ResultMap">
......@@ -90,14 +90,14 @@
where
{{#if entity.logicValid}}
{{#if entity.logicValidField.type.number}}
{{entity.logicValidField.columnName}} = {{entity.validLogicValue}}
t1.{{entity.logicValidField.columnName}} = {{entity.validLogicValue}}
{{else}}
{{entity.logicValidField.columnName}} = '{{entity.validLogicValue}}'
t1.{{entity.logicValidField.columnName}} = '{{entity.validLogicValue}}'
{{/if}}
and
{{/if}}
{{/if}}
({{#each entity.keyFields as |field|}}{{#unless @first}},{{/unless}}{{field.columnName}}{{/each}})
({{#each entity.keyFields as |field|}}{{#unless @first}},{{/unless}}t1.{{field.columnName}}{{/each}})
in (<foreach collection="list" item="item" index="index" separator=","> ({{#each entity.keyFields as |field|}}{{#unless @first}},{{/unless}}#{ item.{{camelCase field.codeName}} }{{/each}}) </foreach>)
</select>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册