Commit 0d2d9f5f by s_guodong

快照优化

parent 370a656e
...@@ -312,7 +312,7 @@ public class SnapshotServiceImpl implements SnapshotService { ...@@ -312,7 +312,7 @@ public class SnapshotServiceImpl implements SnapshotService {
PackComboboxBo data = new PackComboboxBo(); PackComboboxBo data = new PackComboboxBo();
if (StringUtils.isNotBlank(text)) { if (StringUtils.isNotBlank(text)) {
keySet.add(new ValueVo(text, null, attributeValue.getCodeTable())); keySet.add(new ValueVo(text, null, attributeValue.getCodeTable(), attributeValue.getFormatter()));
data.setText("${" + text + "}"); data.setText("${" + text + "}");
} else { } else {
data.setText(""); data.setText("");
...@@ -340,7 +340,7 @@ public class SnapshotServiceImpl implements SnapshotService { ...@@ -340,7 +340,7 @@ public class SnapshotServiceImpl implements SnapshotService {
String text = getAttributeValue(customAttributes).getFieldUrl(); String text = getAttributeValue(customAttributes).getFieldUrl();
PackDateboxBo data = new PackDateboxBo(); PackDateboxBo data = new PackDateboxBo();
if (StringUtils.isNotBlank(text)) { if (StringUtils.isNotBlank(text)) {
keySet.add(new ValueVo(text, textboxBo.getFormat(), null)); keySet.add(new ValueVo(text, textboxBo.getFormat(), null, null));
data.setText("${" + text + "}"); data.setText("${" + text + "}");
} else { } else {
data.setText(""); data.setText("");
...@@ -412,7 +412,7 @@ public class SnapshotServiceImpl implements SnapshotService { ...@@ -412,7 +412,7 @@ public class SnapshotServiceImpl implements SnapshotService {
if (StringUtils.isNotBlank(fieldUrl)) { if (StringUtils.isNotBlank(fieldUrl)) {
data.setChecked("${" + fieldUrl + "}"); data.setChecked("${" + fieldUrl + "}");
keySet.add(new ValueVo(fieldUrl, "X", null)); keySet.add(new ValueVo(fieldUrl, "X", null, null));
} else { } else {
data.setChecked(""); data.setChecked("");
} }
...@@ -477,7 +477,7 @@ public class SnapshotServiceImpl implements SnapshotService { ...@@ -477,7 +477,7 @@ public class SnapshotServiceImpl implements SnapshotService {
for (CustomAttributes customAttributes : customAttributesList) { for (CustomAttributes customAttributes : customAttributesList) {
Object value = map.get(customAttributes.getColumnName()); Object value = map.get(customAttributes.getColumnName());
// 格式转换 // 格式转换
value = formatValue(value, new ValueVo(null, customAttributes.getFormatter(), customAttributes.getCodeTable())); value = formatValue(value, new ValueVo(null, customAttributes.getFormatter(), customAttributes.getCodeTable(), customAttributes.getFormatter()));
PackListcellBo listCellData = new PackListcellBo(); PackListcellBo listCellData = new PackListcellBo();
listCellData.setLabel(value == null ? "" : String.valueOf(value)); listCellData.setLabel(value == null ? "" : String.valueOf(value));
listCellData.setStyle(customAttributes.getColumnStyle()); listCellData.setStyle(customAttributes.getColumnStyle());
...@@ -660,8 +660,9 @@ public class SnapshotServiceImpl implements SnapshotService { ...@@ -660,8 +660,9 @@ public class SnapshotServiceImpl implements SnapshotService {
if (value != null) { if (value != null) {
String format = valueVo.getFormat(); String format = valueVo.getFormat();
String codeTable = valueVo.getCodeTable(); String codeTable = valueVo.getCodeTable();
String formatter = valueVo.getFormatter();
// 从码表中转换 // 从码表中转换
if (StringUtils.isNotBlank(codeTable)) { if (StringUtils.isNotBlank(codeTable) && "{0}".equals(formatter)) {
value = MdaUtils.getCodetableLabel(codeTable, (String) value); value = MdaUtils.getCodetableLabel(codeTable, (String) value);
} }
if (StringUtils.isNotBlank(format)) { if (StringUtils.isNotBlank(format)) {
......
...@@ -12,15 +12,17 @@ public class ValueVo { ...@@ -12,15 +12,17 @@ public class ValueVo {
private String key; private String key;
private String format; private String format;
private String codeTable; private String codeTable;
private String formatter;
public ValueVo(String key) { public ValueVo(String key) {
this.key = key; this.key = key;
} }
public ValueVo(String key, String format, String codeTable) { public ValueVo(String key, String format, String codeTable, String formatter) {
this.key = key; this.key = key;
this.format = format; this.format = format;
this.codeTable = codeTable; this.codeTable = codeTable;
this.formatter = formatter;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment