Source/plt-web/plt-web-parent/plt-web-permission/src/main/java/com/vci/web/util/WebUtil.java
@@ -476,7 +476,7 @@
    public static Map<String,String> getReferAttrName(Class c){
       Map<String,String> fieldMap = new HashMap<String, String>();
       List<Field> allField = getAllFieldForObj(c);
       if(allField!=null&&allField.size()>0){
       if(!CollectionUtils.isEmpty(allField)){
          for(Field field : allField){
             if (field.isAnnotationPresent(Transient.class)){
                //有参照或者枚举
@@ -508,7 +508,7 @@
   public static List<String> getReferBoAttrName(Class c,boolean isNotHasEnum){
       List<String> fieldMap = new ArrayList<String>();
       List<Field> allField = getAllFieldForObj(c);
       if(allField!=null&&allField.size()>0){
       if(!CollectionUtils.isEmpty(allField)){
          for(Field field : allField){
             if (field.isAnnotationPresent(Transient.class)){
                //有参照或者枚举
@@ -524,14 +524,14 @@
    }
    
    /**
     * 获取对象与业务类型里的属性映射
     * @param c 对象所属类
     * @return Map<String,String> 业务类型的字段:对象上的属性
     * 获取DO对象与业务类型里的属性映射
     * @param c DO对象所属类
     * @return Map<String,String> 业务类型的字段(key):DO对象上的属性(value)
     */
    public static Map<String/*业务类型中的字段*/,String/*对象上的属性*/> getFieldNameMap(Class c){
    public static Map<String/*业务类型中的字段*/,String/*DO对象上的属性*/> getFieldNameMap(Class c){
       Map<String,String> fieldMap = new HashMap<String, String>();
       List<Field> allField = getAllFieldForObj(c);
       if(allField!=null&&allField.size()>0){
       if(!CollectionUtils.isEmpty(allField)){
          for(Field field : allField){
             if(!field.getName().equals("serialVersionUID")){
                if(!field.isAnnotationPresent(Transient.class) ){
@@ -555,7 +555,7 @@
          }
       }
      if(!CollectionUtils.isEmpty(fieldMap)){
         //看看有没有null
         //看看有没有null,过滤掉value为null的
         Map<String,String> fieldMapNotNull = new HashMap<>();
         fieldMap.forEach((key,value)->{
            if(value!=null){
@@ -623,7 +623,9 @@
            }
         }
      }
      return VciQueryWrapperForDO.BASE_MODEL_COMPATIBILITY_MAP.getOrDefault(clientBoAttrName.toLowerCase(Locale.ROOT),clientBoAttrName);
      //如果版本本次序号的属性,需要从属性的映射中,获取业务类型中的字段名称
      clientBoAttrName = VciQueryWrapperForDO.BASE_MODEL_COMPATIBILITY_MAP.getOrDefault(clientBoAttrName.toLowerCase(Locale.ROOT),clientBoAttrName);
      return clientBoAttrName;
    }
    
    /**
@@ -653,7 +655,7 @@
     */
    public static Field getPkFieldForObj(Class c){
       List<Field> allField = getAllFieldForObj(c);
       if(allField!=null&&allField.size()>0){
       if(!CollectionUtils.isEmpty(allField)){
          for(Field field : allField){
             if(field.isAnnotationPresent(Id.class)){
                return  field;
@@ -676,7 +678,7 @@
    */
   public static Field getTsField(Class c){
       List<Field> allField = getAllFieldForObj(c);
       if(allField!=null&&allField.size()>0){
       if(!CollectionUtils.isEmpty(allField)){
          for(Field field : allField){
             if(field.getName().equals("ts")){
                return  field;
@@ -707,7 +709,7 @@
    */
   public static Field getFieldForObject(String fieldName,Class c){
       List<Field> allField = getAllFieldForObj(c);
       if(allField!=null&&allField.size()>0){
       if(!CollectionUtils.isEmpty(allField)){
          for(Field field : allField){
             if(field.getName().toLowerCase().equalsIgnoreCase(fieldName.toLowerCase())){
                return  field;
@@ -770,8 +772,8 @@
          try {
             PropertyDescriptor pd = new PropertyDescriptor(fieldName, c);
            return pd.getReadMethod();
         } catch (SecurityException e) {
         } catch (IntrospectionException e) {
         } catch (Exception e) {
            //TODO 不做任何处理
         }
       }
       return null;
@@ -1140,7 +1142,7 @@
    * @param bo 业务数据
    * @param obj 对象
    */
   public static void copyValueToObjectFromBos(com.vci.corba.omd.data.BusinessObject bo ,Object obj){
   public static void copyValueToObjectFromBos(BusinessObject bo ,Object obj){
      copyValueToObjectFromBos(bo,obj,null);
   }
@@ -1150,31 +1152,57 @@
    * @param obj 对象
    * @param fieldAttrMap 属性映射
    */
    public static void copyValueToObjectFromBos(com.vci.corba.omd.data.BusinessObject bo , Object obj, Map<String,String> fieldAttrMap){
    public static void copyValueToObjectFromBos(BusinessObject bo , Object obj, Map<String,String> fieldAttrMap){
       if(bo!=null && obj != null){
          //先把所有的字段映射找到
          if(fieldAttrMap == null){
             fieldAttrMap = getFieldNameMap(obj.getClass());
          }
         com.vci.corba.omd.data.AttributeValue[] newAList = bo.newAttrValList;
         com.vci.corba.omd.data.AttributeValue[] hisAList = bo.hisAttrValList;
         AttributeValue[] newAList = bo.newAttrValList;
         AttributeValue[] hisAList = bo.hisAttrValList;
         //要先把BO对象上的值拷贝过去
         List<Field> boFields = getAllFieldForObj(bo.getClass());
         if(boFields!=null){
         if(!CollectionUtils.isEmpty(boFields)){
            for(Field field :boFields){
               if(fieldAttrMap.containsKey(field.getName().toLowerCase())){
                  //说明这个就是在BO对象上的
                  Object value = getValueFromField(field.getName(), bo);
                  if(value !=null){
                  //BusinessObject和BaseModel中,以下的属性,不相同,需要单独处理
                  switch (field.getName().toLowerCase()){
                     case "revoid":
                        setValueForFieldFromCbo("revisionOid", obj, getStringValueFromObject(value));
                        break;
                     case "btname":
                        setValueForFieldFromCbo("btmName", obj, getStringValueFromObject(value));
                        break;
                     case "islastr":
                        setValueForFieldFromCbo("lastr", obj, getStringValueFromObject(value).equalsIgnoreCase("true")?"1":"0");
                        break;
                     case "isfirstr":
                        setValueForFieldFromCbo("firstr", obj, getStringValueFromObject(value).equalsIgnoreCase("true")?"1":"0");
                        break;
                     case "islastv":
                        setValueForFieldFromCbo("lastv", obj, getStringValueFromObject(value).equalsIgnoreCase("true")?"1":"0");
                        break;
                     case "isfirstv":
                        setValueForFieldFromCbo("firstv", obj, getStringValueFromObject(value).equalsIgnoreCase("true")?"1":"0");
                        break;
                     case "modifytime":
                        setValueForFieldFromCbo("lastmodifytime", obj, getStringValueFromObject(value));
                        break;
                     case "fromversion":
                        setValueForFieldFromCbo("copyFromVersion", obj, getStringValueFromObject(value));
                        break;
                     default:
                     setValueForFieldFromCbo(fieldAttrMap.get(field.getName().toLowerCase()), obj, getStringValueFromObject(value));
                        break;
                  }
               }
            }
         }
         if(newAList!=null&&newAList.length>0){
            for(int i = 0 ; i < newAList.length;i++){
               com.vci.corba.omd.data.AttributeValue av = newAList[i];
               AttributeValue av = newAList[i];
               String attrName = av.name.toLowerCase();
               if(fieldAttrMap.containsKey(attrName)) {
                  String fieldName = fieldAttrMap.get(attrName);
@@ -1184,7 +1212,6 @@
                     if(fieldName!=null && fieldName.equalsIgnoreCase(attrName) && cboField.contains(".")){
                        //参照的时候
                        setValueForFieldFromCbo(fieldName, obj, av.value);
                        return;
                     }
                  });
               }
@@ -1192,7 +1219,7 @@
         }
         if(hisAList!=null&&hisAList.length>0){
            for(int i = 0 ; i < hisAList.length;i++){
               com.vci.corba.omd.data.AttributeValue av = hisAList[i];
               AttributeValue av = hisAList[i];
               String attrName = av.name.toLowerCase();
               String fieldName = fieldAttrMap.get(attrName);
               if(fieldName!=null){
@@ -1202,7 +1229,6 @@
                     if(field!=null && field.equalsIgnoreCase(attrName) && cboField.contains(".")){
                        //参照的时候
                        setValueForFieldFromCbo(field, obj, av.value);
                        return;
                     }
                  });
               }
@@ -1227,21 +1253,21 @@
    * @param bo 业务数据
    * @param map map
    */
    public static void copyValueToMapFromBos(com.vci.corba.omd.data.BusinessObject bo, Map<String,String> map){
    public static void copyValueToMapFromBos(BusinessObject bo, Map<String,String> map){
       if(bo!=null ){
          //先把所有的字段映射找到
         com.vci.corba.omd.data.AttributeValue[] newAList = bo.newAttrValList;
         com.vci.corba.omd.data.AttributeValue[] hisAList = bo.hisAttrValList;
         AttributeValue[] newAList = bo.newAttrValList;
         AttributeValue[] hisAList = bo.hisAttrValList;
         if(hisAList!=null&&hisAList.length>0){//
            for(int i = 0 ; i < hisAList.length;i++){
               com.vci.corba.omd.data.AttributeValue av = hisAList[i];
               AttributeValue av = hisAList[i];
               String attrName = av.name.toLowerCase();
               map.put(attrName, av.value);
            }
         }
         if(newAList!=null&&newAList.length>0){//NEW的优先级高些
            for(int i = 0 ; i < newAList.length;i++){
               com.vci.corba.omd.data.AttributeValue av = newAList[i];
               AttributeValue av = newAList[i];
               String attrName = av.name.toLowerCase();
               map.put(attrName, av.value);
            }
@@ -1358,11 +1384,130 @@
             if(value == null){
                value = "";
             }
            if(isDefaultField(key)){
               setValueToField(key, cbo, value);
            if(isDefaultField(key.toLowerCase())){
               //重新单独处理。因为BaseModel的基础属性和BusinessObject中的有所差异
               setValueToCboField(key.toLowerCase(), cbo, value);
            }
            ObjectTool.setBOAttributeValue(cbo,key.toLowerCase(), value);
         }
       }
    }
   /**
    * 给BusinessObject对象中的属性设置值
    * @param fieldName 表中字段或DO对象中的属性
    * @param bo BusinessObject
    * @param value 属性值
    */
   public static void setValueToCboField(String fieldName, BusinessObject bo, String value){
      switch (fieldName){
         case "oid":
            bo.oid = value;
            break;
         case "revisionoid":
            bo.revoid = value;
            break;
         case "nameoid":
            bo.nameoid = value;
            break;
         case "btmname":
            bo.btName = value;
            break;
         case "lastr":
            bo.isLastR = "1".equals(value);
            break;
         case "firstr":
            bo.isFirstR = "1".equals(value);
            break;
         case "lastv":
            bo.isLastV = "1".equals(value);
            break;
         case "firstv":
            bo.isFirstV = "1".equals(value);
            break;
         case "creator":
            bo.creator = value;
            break;
         case "createtime":
            try {
               long createTime = Long.parseLong(value);
               bo.createTime = createTime;
            } catch (NumberFormatException e) {
               try {
                  bo.createTime = VciDateUtil.str2Date(value, VciDateUtil.DateTimeFormat).getTime();
               } catch (Exception e2) {
                  //TODO
               }
            }
            break;
         case "lastmodifier":
            bo.modifier = value;
            break;
         case "lastmodifytime":
            try {
               long lastModifyTime = Long.parseLong(value);
               bo.modifyTime = lastModifyTime;
            } catch (NumberFormatException e) {
               try {
                  bo.modifyTime = VciDateUtil.str2Date(value, VciDateUtil.DateTimeFormat).getTime();
               } catch (Exception e2) {
                  //TODO
               }
            }
            break;
         case "revisionrule":
            bo.revisionRule = value;
            break;
         case "versionrule":
            bo.versionRule = value;
            break;
         case "revisionseq":
            bo.revisionSeq = Short.parseShort(value);
            break;
         case "revisionvalue":
            bo.revisionValue = value;
            break;
         case "versionseq":
            bo.versionSeq = Short.parseShort(value);
            break;
         case "versionvalue":
            bo.versionValue = value;
            break;
         case "lctid":
            bo.lctId = value;
            break;
         case "lcstatus":
            bo.lcStatus = value;
            break;
         case "ts":
            try {
               long ts = Long.parseLong(value);
               bo.ts = ts;
            } catch (NumberFormatException e) {
               try {
                  bo.ts = VciDateUtil.str2Date(value, VciDateUtil.DateTimeFormat).getTime();
               } catch (Exception e2) {
                  //TODO
               }
            }
            break;
         case "id":
            bo.id = value;
            break;
         case "name":
            bo.name = value;
            break;
         case "description":
            bo.description = value;
            break;
         case "owner":
            bo.owner = value;
            break;
         case "copyfromversion":
            bo.fromVersion = value;
            break;
         default:
            break;
       }
    }
@@ -1380,7 +1525,7 @@
             if(value == null){
                value = "";
             }
            if(isDefaultField(key)){
            if(isDefaultField(key.toLowerCase())){
               setValueToField(key, clo, value);
            }else {
               ObjectTool.setLOAttributeValue(clo,key.toLowerCase(), value);
@@ -1420,7 +1565,7 @@
             if(value==null){
                value = "";
             }
            if(isDefaultField(fieldName)){
            if(isDefaultField(fieldName.toLowerCase())){
               setValueToField(fieldName, cbo, value);
            }
            ObjectTool.setBOAttributeValue(cbo,attrName.toLowerCase(), value);
@@ -1435,7 +1580,7 @@
    */
   public static boolean isDefaultField(String fieldNames){
      if(VciQueryWrapperForDO.BASIC_FIELD_MAP.containsKey(fieldNames) || VciQueryWrapperForDO.LIFECYCLE_MANAGE_FIELD_MAP.containsKey(fieldNames)
      || VciQueryWrapperForDO.REVISION_MANAGE_FIELD_MAP.containsKey(fieldNames) ) {
      || VciQueryWrapperForDO.REVISION_MANAGE_FIELD_MAP.containsKey(fieldNames) || VciQueryWrapperForDO.BASE_MODEL_COMPATIBILITY_MAP.containsValue(fieldNames)) {
          return true;
       }
       return false;
@@ -1729,4 +1874,20 @@
      }
      return BusinessObject;
   }
   /**
    * 获取对象中的属性集合。
    * @param tClass 对象
    * @return 属性集合Map。key:属性名称,value:属性
    */
   public static Map<String, Field> getFieldMapForObject(Class tClass) {
      Map<String, Field> fieldMap = new HashMap<>();
      List<Field> allField = getAllFieldForObj(tClass);
      if(!CollectionUtils.isEmpty(allField)){
         for(Field field : allField){
            fieldMap.put(field.getName(), field);
         }
      }
      return fieldMap;
   }
}