|
|
|
@@ -12,10 +12,11 @@ import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.iformall.domain.po.WxFinancePrintData; |
|
|
|
import com.iformall.enums.EnumYesOrNo; |
|
|
|
import com.iformall.print.entity.PrintDataBraidTable; |
|
|
|
import com.iformall.print.entity.PrintDataBraidTableColumns; |
|
|
|
import com.iformall.print.entity.PrintDataBraidTableColumnsTrSet; |
|
|
|
import com.iformall.print.entity.PrintDataBraidTxt; |
|
|
|
import com.iformall.print.entity.PrintComponent; |
|
|
|
import com.iformall.print.entity.component.table.PrintBraidTable; |
|
|
|
import com.iformall.print.entity.component.table.PrintBraidTableColumns; |
|
|
|
import com.iformall.print.entity.component.table.PrintBraidTableColumnsTrSet; |
|
|
|
import com.iformall.print.entity.component.txt.PrintBraidTxt; |
|
|
|
|
|
|
|
@Data |
|
|
|
public class PrintDataHandler implements Serializable { |
|
|
|
@@ -25,7 +26,7 @@ public class PrintDataHandler implements Serializable { |
|
|
|
public static Object parseComponent(WxFinancePrintData data) { |
|
|
|
JSONObject dataJson = JSON.parseObject(data.getPrintDataJson()); |
|
|
|
if("braid-txt".equals(data.getPrintDataType())) { |
|
|
|
PrintDataBraidTxt txt = new PrintDataBraidTxt(); |
|
|
|
PrintBraidTxt txt = new PrintBraidTxt(); |
|
|
|
txt.setTitle(data.getName()); |
|
|
|
txt.setIsEdit(data.getIsEdit()); |
|
|
|
txt.setName(dataJson.getString("fieldName")); |
|
|
|
@@ -33,19 +34,19 @@ public class PrintDataHandler implements Serializable { |
|
|
|
txt.setDefaultValue(txt.getTitle()); |
|
|
|
return txt; |
|
|
|
}else if ("braid-table".equals(data.getPrintDataType())) { |
|
|
|
PrintDataBraidTable table = new PrintDataBraidTable(); |
|
|
|
PrintBraidTable table = new PrintBraidTable(); |
|
|
|
table.setTitle(data.getName()); |
|
|
|
table.setIsEdit(data.getIsEdit()); |
|
|
|
table.setName(dataJson.getString("fieldName")); |
|
|
|
table.setValue("{"+data.getName()+"}"); |
|
|
|
List<PrintDataBraidTableColumns> columnsAttr = new ArrayList<PrintDataBraidTableColumns>(); |
|
|
|
List<PrintBraidTableColumns> columnsAttr = new ArrayList<PrintBraidTableColumns>(); |
|
|
|
JSONArray columns = dataJson.getJSONArray("columns"); |
|
|
|
if (null != columns) { |
|
|
|
List<Map> defaultvalues = new ArrayList<Map>(); |
|
|
|
Map dv = new HashMap(); |
|
|
|
for (int i = 0 ; i < columns.size() ; i ++) { |
|
|
|
JSONObject o = columns.getJSONObject(i); |
|
|
|
PrintDataBraidTableColumns tc = new PrintDataBraidTableColumns(); |
|
|
|
PrintBraidTableColumns tc = new PrintBraidTableColumns(); |
|
|
|
tc.setTitle(o.getString("title")); |
|
|
|
tc.setValue("{"+tc.getTitle()+"}"); |
|
|
|
tc.setName(o.getString("fieldName")); |
|
|
|
@@ -53,7 +54,7 @@ public class PrintDataHandler implements Serializable { |
|
|
|
columnsAttr.add(tc); |
|
|
|
JSONObject trsets = o.getJSONObject("trSet"); |
|
|
|
if (null != trsets) { |
|
|
|
PrintDataBraidTableColumnsTrSet ptrset = new PrintDataBraidTableColumnsTrSet(); |
|
|
|
PrintBraidTableColumnsTrSet ptrset = new PrintBraidTableColumnsTrSet(); |
|
|
|
ptrset.setTitle(trsets.getString("title")); |
|
|
|
ptrset.setCol(trsets.getInteger("col")); |
|
|
|
ptrset.setMargin(trsets.getString("margin")); |
|
|
|
|