Pārlūkot izejas kodu

修复链接参数使用#表达式取值时如果当前单元格存在数据映射当展开数据只有一条时取值为映射后值的BUG

master
jacky6024 pirms 7 gadiem
vecāks
revīzija
41db5898da
  1. 39
      ureport2-core/src/main/java/com/bstek/ureport/build/cell/NoneExpandBuilder.java

39
ureport2-core/src/main/java/com/bstek/ureport/build/cell/NoneExpandBuilder.java

@ -30,26 +30,33 @@ public class NoneExpandBuilder implements CellBuilder {
@Override
public Cell buildCell(List<BindData> dataList, Cell cell, Context context) {
Object obj=null;
List<Object> bindData=null;
for(BindData data:dataList){
if(obj==null){
if(data.getLabel()==null){
obj=data.getValue();
}else{
obj=data.getLabel();
}
}else{
if(data.getLabel()==null){
obj=obj+","+data.getValue();
if(dataList.size()==1){
BindData bindData=dataList.get(0);
cell.setData(bindData.getValue());
cell.setFormatData(bindData.getLabel());
cell.setBindData(bindData.getDataList());
}else{
Object obj=null;
List<Object> bindData=null;
for(BindData data:dataList){
if(obj==null){
if(data.getLabel()==null){
obj=data.getValue();
}else{
obj=data.getLabel();
}
}else{
obj=obj+","+data.getLabel();
if(data.getLabel()==null){
obj=obj+","+data.getValue();
}else{
obj=obj+","+data.getLabel();
}
}
bindData=data.getDataList();
}
bindData=data.getDataList();
cell.setData(obj);
cell.setBindData(bindData);
}
cell.setData(obj);
cell.setBindData(bindData);
List<ConditionPropertyItem> conditionPropertyItems=cell.getConditionPropertyItems();
if(conditionPropertyItems!=null && conditionPropertyItems.size()>0){
context.getReport().getLazyComputeCells().add(cell);

Notiek ielāde…
Atcelt
Saglabāt