|
|
@@ -128,13 +128,10 @@ public class ResumeWordTemplateServiceImplEx extends ResumeWordTemplateServiceIm
|
|
|
while (rowSet.next()) {
|
|
|
Map<String, String> rowData = new HashMap<String, String>();
|
|
|
for (Map.Entry<String, String> entry : selectKeyToWordKeyMap.entrySet()) {
|
|
|
- if (!isYgzzkSelectKey(entry.getKey())) {
|
|
|
- continue;
|
|
|
- }
|
|
|
String wordKey = entry.getValue();
|
|
|
Object dbValue = rowSet.getObject(entry.getKey());
|
|
|
String displayValue = dataTypeHandle(ctx, dbValue, columnsInfoMap.get(wordKey));
|
|
|
- if (matchesYgzzkField(entry.getKey(), YGZZK_SORT_FIELD)) {
|
|
|
+ if (matchesYgzzkFieldSuffix(entry.getKey(), YGZZK_SORT_FIELD)) {
|
|
|
displayValue = formatYgzzkKaoheshij(displayValue);
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(displayValue)) {
|
|
|
@@ -270,31 +267,39 @@ public class ResumeWordTemplateServiceImplEx extends ResumeWordTemplateServiceIm
|
|
|
return false;
|
|
|
}
|
|
|
for (String key : selectMapping.keySet()) {
|
|
|
- if (isYgzzkSelectKey(key)) {
|
|
|
+ if (isYgzzkQuerySelectKey(key)) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- private boolean isYgzzkSelectKey(String selectKey) {
|
|
|
+ /**
|
|
|
+ * ygzzk 主表字段以 YGZZK. 开头;关联字段如 kaohe2.name、kaohezzwenb 为独立 clientNumber,不在此前缀下。
|
|
|
+ */
|
|
|
+ private boolean isYgzzkQuerySelectKey(String selectKey) {
|
|
|
if (selectKey == null) {
|
|
|
return false;
|
|
|
}
|
|
|
- return selectKey.toUpperCase().startsWith(YGZZK_ENTITY + ".");
|
|
|
+ if (selectKey.toUpperCase().startsWith(YGZZK_ENTITY + ".")) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ for (int i = 0; i < YGZZK_FIELD_ORDER.length; i++) {
|
|
|
+ if (matchesYgzzkFieldSuffix(selectKey, YGZZK_FIELD_ORDER[i])) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
- private boolean matchesYgzzkField(String selectKey, String fieldSuffix) {
|
|
|
+ private boolean matchesYgzzkFieldSuffix(String selectKey, String fieldSuffix) {
|
|
|
if (selectKey == null || fieldSuffix == null) {
|
|
|
return false;
|
|
|
}
|
|
|
- if (!isYgzzkSelectKey(selectKey)) {
|
|
|
- return false;
|
|
|
+ if (selectKey.equalsIgnoreCase(fieldSuffix)) {
|
|
|
+ return true;
|
|
|
}
|
|
|
- String upperKey = selectKey.toUpperCase();
|
|
|
- String upperSuffix = fieldSuffix.toUpperCase();
|
|
|
- return upperKey.equals(YGZZK_ENTITY + "." + upperSuffix)
|
|
|
- || upperKey.endsWith("." + upperSuffix);
|
|
|
+ return selectKey.toUpperCase().endsWith("." + fieldSuffix.toUpperCase());
|
|
|
}
|
|
|
|
|
|
private List<String> buildYgzzkOrderedWordKeys(Map<String, String> selectKeyToWordKeyMap) {
|
|
|
@@ -304,7 +309,7 @@ public class ResumeWordTemplateServiceImplEx extends ResumeWordTemplateServiceIm
|
|
|
}
|
|
|
if (selectKeyToWordKeyMap != null) {
|
|
|
for (String selectKey : selectKeyToWordKeyMap.keySet()) {
|
|
|
- if (isYgzzkSelectKey(selectKey) && !orderedSelectKeys.contains(selectKey)) {
|
|
|
+ if (!orderedSelectKeys.contains(selectKey)) {
|
|
|
orderedSelectKeys.add(selectKey);
|
|
|
}
|
|
|
}
|
|
|
@@ -328,7 +333,7 @@ public class ResumeWordTemplateServiceImplEx extends ResumeWordTemplateServiceIm
|
|
|
return;
|
|
|
}
|
|
|
for (String selectKey : selectKeyToWordKeyMap.keySet()) {
|
|
|
- if (matchesYgzzkField(selectKey, fieldSuffix) && !orderedSelectKeys.contains(selectKey)) {
|
|
|
+ if (matchesYgzzkFieldSuffix(selectKey, fieldSuffix) && !orderedSelectKeys.contains(selectKey)) {
|
|
|
orderedSelectKeys.add(selectKey);
|
|
|
}
|
|
|
}
|