田源
2023-08-02 c60cd894eb40f978a7a587c0f72232d704eede08
Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/util/VciBaseUtil.java
@@ -1294,7 +1294,7 @@
    * @return Map对象
    * @version 2016年3月20日 11:03:01
    */
   public static Map convertBean2Map(Object bean) throws Exception {
   public static Map convertBean2Map(Object bean,Set<String> existFild) throws Exception {
      Class type = bean.getClass();
      Map returnMap = new HashMap();
      BeanInfo beanInfo = Introspector.getBeanInfo(type);
@@ -1332,11 +1332,20 @@
            if (result != null) {
               if ("data".equals(propertyName)){
                  returnMap.putAll((Map) result);
               }else {
                  if(existFild == null){
                     returnMap.putAll((Map) result);
                  }else{
                     Map resulMapChild = (Map) result;
                     for (Object o : resulMapChild.keySet()) {
                        if(existFild.contains(String.valueOf(o).toLowerCase())){
                           returnMap.put(String.valueOf(o).toLowerCase(),resulMapChild.get(o));
                        }
                     }
                  }
               }else if(existFild.contains((fieldMap.containsKey(propertyName)?fieldMap.get(propertyName):propertyName).toLowerCase())){
                  returnMap.put(fieldMap.containsKey(propertyName)?fieldMap.get(propertyName):propertyName, result);
               }
            } else {
            } else if(existFild.contains((fieldMap.containsKey(propertyName)?fieldMap.get(propertyName):propertyName).toLowerCase())){
               returnMap.put(fieldMap.containsKey(propertyName)?fieldMap.get(propertyName):propertyName, "");
            }
         }