sumList
#function sumList($list, $fieldId)
#if ($vs.util.isList($list))
#set($sum = 0)
#foreach($item in $list)
#set($value = $item)
#if ($vs.util.isNotNull($fieldId))
#set($value = $item.get($fieldId))
#end
#set($sum = $vs.util.precise($sum, $value, '+'))
#end
return $sum
#end
#end
sumGroup
#function sumGroup($group, $fieldId)
#if ($vs.util.isMap($group))
#set($result = $vs.util.newMap())
#foreach($key in $vs.util.getMapKeys($group))
#set($list = $group.get($key))
#set($sum = 0)
#foreach($item in $list)
#if ($vs.util.isNotNull($fieldId))
#set($value = $item.get($fieldId))
#set($sum = $vs.util.precise($sum, $value, '+'))
#end
#end
$result.put($key, $sum)
#end
return $result
#end
#end