freemarker迭代List

Map map=new HashMap<>();
<#list map?keys as key>
    索引号:${key_index}
<#if key??>
    截取key: ${key?substring(0,1)}
<#if map[key]??>
<#list map[key] as DayProgre>
    ${(DayProgre.editTime)!}





substring(start,end)截取从start索引开始到(end-1)索引之间的字符,截取总长度为(end-start);

//listRpcSubprojectProgre和subDayProgreList是同一级,需要通过索引迭代
List>> subDayProgreList=new ArrayList<>();
<#if listRpcSubprojectProgre??>
<#list listRpcSubprojectProgre as rpcSubprojectProgre>
    <#list subDayProgreList[rpcSubprojectProgre_index]?keys as key>
    <#if subDayProgreList[rpcSubprojectProgre_index]??>
         截取key:${key?substring(37,47)}
        <#if subDayProgreList[rpcSubprojectProgre_index][key]??>
        <#list subDayProgreList[rpcSubprojectProgre_index][key] as DayProgre>
            工程量:${(DayProgre.enginQuantity)!}
        
        
    
   

你可能感兴趣的:(freemarker迭代List)