处理模板问题

This commit is contained in:
wenc000 2020-04-28 21:56:40 +08:00
parent 64e94c8d1c
commit ca169f07cd
4 changed files with 42 additions and 5 deletions

View File

@ -195,6 +195,9 @@ public class DynamicConfigTableServiceImpl extends AbstractService implements ID
if (StringUtils.equals(FieldTypeEnum.RADIO.getValue(), dynamicConfigFormDTO.getFieldType())
|| StringUtils.equals(FieldTypeEnum.CHECKBOX.getValue(), dynamicConfigFormDTO.getFieldType())
|| StringUtils.equals(FieldTypeEnum.SELECT.getValue(), dynamicConfigFormDTO.getFieldType())) {
if (StringUtils.equals(FieldTypeEnum.CHECKBOX.getValue(), dynamicConfigFormDTO.getFieldType())) {
templateMap.put("isCheckboxExist", "exist");
}
field.put("dictionaryIndex", ++dictionaryIndex);
} else if (StringUtils.equals(FieldTypeEnum.INNER_JOIN.getValue(), dynamicConfigFormDTO.getFieldType())
|| StringUtils.equals(FieldTypeEnum.LEFT_JOIN.getValue(), dynamicConfigFormDTO.getFieldType())

View File

@ -147,7 +147,10 @@
<if test="isCheckboxExist != null and isCheckboxExist == 'exist'">
GROUP BY
t1.${uuidField}
<foreach collection="listShowFieldList" item="item" open="," separator="," close="">
<foreach collection="listShowFieldList" item="item" index="index" open="," separator="," close="">
<if test="item.fieldType == 'radio' or item.fieldType == 'select'">
dt${index + 1}.dictionary_name,
</if>
t1.${item.fieldName}
</foreach>
<if test="listJoinTableField != null and listJoinTableField.size > 0">

View File

@ -122,8 +122,11 @@
<#if field.listShow == 1>
t1.${field.underLineFieldName},
<#-- 字典 start -->
<#if field.fieldType == "radio" || field.fieldType == "checkbox" || field.fieldType == "select">
<#if field.fieldType == "radio" || field.fieldType == "select">
dt${field.dictionaryIndex}.dictionary_name ${field.underLineFieldName}_dictionary_name,
</#if>
<#if field.fieldType == "checkbox">
GROUP_CONCAT(DISTINCT dt${field.dictionaryIndex}.dictionary_name) ${field.underLineFieldName}_dictionary_name,
</#if>
<#-- 字典 end -->
</#if>
@ -142,7 +145,14 @@
${tablePrefix}${underLineTableName} t1
<#list fieldList! as field>
<#if field.listShow == 1>
<#if field.fieldType == "radio" || field.fieldType == "checkbox" || field.fieldType == "select">
<#if field.fieldType == "radio" || field.fieldType == "select">
LEFT JOIN
data_dictionary dt${field.dictionaryIndex}
ON
dt${field.dictionaryIndex}.dictionary_id = t1.${field.underLineFieldName}
AND
dt${field.dictionaryIndex}.is_delete = 0
<#if field.fieldType == "checkbox">
LEFT JOIN
data_dictionary dt${field.dictionaryIndex}
ON
@ -193,6 +203,27 @@
${r"#{"}${firstLowerTableName}${r"Ids[${index}]}"}
</foreach>
</if>
<#if isCheckboxExist == 'exist'>
GROUP BY
<#list fieldList! as field>
<#if field.listShow == 1>
t1.${field.underLineFieldName},
<#if field.fieldType == "radio" || field.fieldType == "select">
dt${field.dictionaryIndex}.dictionary_name,
</#if>
</#if>
<#-- 联表 start -->
<#if field.fieldType == "innerJoin" || field.fieldType == "leftJoin" || field.fieldType == "rightJoin">
<#list field.listJoinTableField! as joinTableField>
<#if joinTableField.listShow == 1>
jt${field.joinTableIndex}.${joinTableField.underLineFieldName},
</#if>
</#list>
</#if>
<#-- 联表 end -->
</#list>
t1.${underLineTableName}_id
</#if>
</select>
<!-- ${tableExplain}统计 -->

View File

@ -108,9 +108,9 @@
}
return downloadFile;
<#elseif field.fieldType == "date">
return common.formatDate('yyyy-MM-dd', new Date(rowData));
return rowData;
<#elseif field.fieldType == "datetime">
return common.formatDate('yyyy-MM-dd hh:mm:ss', new Date(rowData));
return rowData;
<#elseif field.fieldType == "selectUser">
var selectArray = rowData.split(',');
var value = '';