From 8e6720335da2a40ec10aaad4232ce1026c926aad Mon Sep 17 00:00:00 2001 From: "youHong.ai" <774495953@qq.com> Date: Wed, 21 Dec 2022 23:22:58 +0800 Subject: [PATCH] fix dealwithmapping lowecase bug --- .../config/service/DealWithMapping.java | 72 ++++++++++++++----- 1 file changed, 56 insertions(+), 16 deletions(-) diff --git a/src/main/java/weaver/xiao/commons/config/service/DealWithMapping.java b/src/main/java/weaver/xiao/commons/config/service/DealWithMapping.java index 458f9f8..44b939b 100644 --- a/src/main/java/weaver/xiao/commons/config/service/DealWithMapping.java +++ b/src/main/java/weaver/xiao/commons/config/service/DealWithMapping.java @@ -557,11 +557,18 @@ public class DealWithMapping extends ToolUtil { // 流程字段 case WORKFLOW_FIELD: { FieldMessage fieldMassage = mappingDetail.getFieldMassage(); - String fieldName = fieldMassage.getFieldName().toLowerCase(); + String fieldName = fieldMassage.getFieldName(); + String fieldNameLower = fieldName.toLowerCase(); if ("1".equals(childSource)) { - value = Util.null2String(detailMap.get(fieldName)); + value = Util.null2String(detailMap.get(fieldNameLower)); + if ("".equals(value)) { + value = Util.null2String(detailMap.get(fieldName)); + } } else { - value = Util.null2String(mainMap.get(fieldName)); + value = Util.null2String(mainMap.get(fieldNameLower)); + if ("".equals(value)) { + value = Util.null2String(mainMap.get(fieldName)); + } } } break; @@ -570,11 +577,18 @@ public class DealWithMapping extends ToolUtil { FieldMessage fieldMassage = mappingDetail.getFieldMassage(); String workFlowVal = ""; if (fieldMassage != null) { - String fieldName = fieldMassage.getFieldName().toLowerCase(); + String fieldName = fieldMassage.getFieldName(); + String fieldNameLowe = fieldName.toLowerCase(); if ("1".equals(childSource)) { - workFlowVal = Util.null2String(detailMap.get(fieldName)); + workFlowVal = Util.null2String(detailMap.get(fieldNameLowe)); + if ("".equals(workFlowVal)) { + workFlowVal = Util.null2String(detailMap.get(fieldName)); + } } else if ("0".equals(childSource)) { - workFlowVal = Util.null2String(mainMap.get(fieldName)); + workFlowVal = Util.null2String(mainMap.get(fieldNameLowe)); + if ("".equals(workFlowVal)) { + workFlowVal = Util.null2String(mainMap.get(fieldName)); + } } } value = Util.null2String(valueContext) @@ -819,18 +833,31 @@ public class DealWithMapping extends ToolUtil { // 流程字段 case WORKFLOW_FIELD: { FieldMessage fieldMassage = mappingDetail.getFieldMassage(); - String fieldName = fieldMassage.getFieldName().toLowerCase(); + String fieldName = fieldMassage.getFieldName(); + String fieldNameLower = fieldName.toLowerCase(); this.writeDebuggerLog("fieldName:" + fieldName); if ("1".equals(childSource)) { - value = Util.null2String(detailMap.get(fieldName)); + value = Util.null2String(detailMap.get(fieldNameLower)); + if ("".equals(value)) { + value = Util.null2String(detailMap.get(fieldName)); + } } else if ("0".equals(childSource)) { - value = Util.null2String(mainMap.get(fieldName)); + value = Util.null2String(mainMap.get(fieldNameLower)); + if ("".equals(value)) { + value = Util.null2String(mainMap.get(fieldName)); + } } else { - value = Util.null2String(relationRs.getString(fieldName)); + value = Util.null2String(relationRs.getString(fieldNameLower)); + if ("".equals(value)) { + value = Util.null2String(relationRs.getString(fieldName)); + } } if ("rootNode".equals(mappingDetail.getBelongTo()) && "2".equals(childSource)) { writeDebuggerLog("主表取关联流程字段 => " + paramName); - value = Util.null2String(tempRs.getString(fieldName)); + value = Util.null2String(tempRs.getString(fieldNameLower)); + if ("".equals(value)) { + value = Util.null2String(tempRs.getString(fieldName)); + } } } break; @@ -839,16 +866,29 @@ public class DealWithMapping extends ToolUtil { FieldMessage fieldMassage = mappingDetail.getFieldMassage(); String workFlowVal = ""; if (fieldMassage != null) { - String fieldName = fieldMassage.getFieldName().toLowerCase(); + String fieldName = fieldMassage.getFieldName(); + String fieldNameLower = fieldName.toLowerCase(); if ("1".equals(childSource)) { - workFlowVal = Util.null2String(detailMap.get(fieldName)); + workFlowVal = Util.null2String(detailMap.get(fieldNameLower)); + if ("".equals(workFlowVal)) { + workFlowVal = Util.null2String(detailMap.get(fieldName)); + } } else if ("0".equals(childSource)) { - workFlowVal = Util.null2String(mainMap.get(fieldName)); + workFlowVal = Util.null2String(mainMap.get(fieldNameLower)); + if ("".equals(workFlowVal)) { + workFlowVal = Util.null2String(mainMap.get(fieldName)); + } } else { - workFlowVal = Util.null2String(relationRs.getString(fieldName)); + workFlowVal = Util.null2String(relationRs.getString(fieldNameLower)); + if ("".equals(workFlowVal)) { + workFlowVal = Util.null2String(relationRs.getString(fieldName)); + } } if ("rootNode".equals(mappingDetail.getBelongTo()) && "2".equals(childSource)) { - workFlowVal = Util.null2String(tempRs.getString(fieldName)); + workFlowVal = Util.null2String(tempRs.getString(fieldNameLower)); + if ("".equals(workFlowVal)) { + workFlowVal = Util.null2String(tempRs.getString(fieldName)); + } } } value = Util.null2String(valueContext)