Prechádzať zdrojové kódy

fix: 修复checkmax

Marko552 4 rokov pred
rodič
commit
3798a576d9

+ 1 - 1
abi-cloud-qr-platform-common/src/main/java/com/abi/task/common/excel/ExcelInputFactory.java

@@ -166,7 +166,7 @@ public class ExcelInputFactory {
                     }
                     //调用method
                     Method method = methodCache.get(fieldName);
-                    method.invoke(t, StrUtils.filterHtml(String.valueOf(value)));
+                    method.invoke(t, StrUtils.filterHtml(String.valueOf(value).replaceAll(" ", " ")));
                 }
                 excelPojoList.add(t);
             } catch (Exception e) {

+ 3 - 3
abi-cloud-qr-platform-common/src/main/java/com/abi/task/common/tablestore/TableStorePlusUtils.java

@@ -9,6 +9,7 @@ import com.abi.task.common.tablestore.common.TableStoreEntity;
 import com.abi.task.common.tablestore.common.TableStoreReq;
 import com.abi.task.common.tablestore.common.TableStoreRes;
 import com.abi.task.common.utils.IStringUtil;
+import com.abi.task.common.utils.StrUtils;
 import com.alicloud.openservices.tablestore.model.Column;
 import com.alicloud.openservices.tablestore.model.ColumnValue;
 import com.alicloud.openservices.tablestore.model.PrimaryKeyColumn;
@@ -311,7 +312,7 @@ public class TableStorePlusUtils {
                 Method method = clz.getMethod("set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1), fieldType);
                 if (columnVal != null) {
                     if (fieldType == String.class) {
-                        fieldValue = (String) columnVal;
+                        fieldValue = StrUtils.filterHtml((String) columnVal);
                     } else if (fieldType == Integer.class) {
                         fieldValue = Integer.valueOf(String.valueOf(columnVal));
                     } else if (fieldType == Long.class) {
@@ -329,9 +330,8 @@ public class TableStorePlusUtils {
                         continue;
                     }
                 }
-
                 //反射调用set
-                method.invoke(entity, fieldValue);
+                method.invoke(entity,  fieldValue);
             }
         }catch (Exception e){
             log.info("转换异常",e);

+ 6 - 2
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/GenerateCodeServiceImpl.java

@@ -322,12 +322,16 @@ public class GenerateCodeServiceImpl implements GenerateCodeService {
             log.warn("文件读取异常",e);
         }finally {
             try {
-                os.close();
+                if (os != null) {
+                    os.close();
+                }
             } catch (IOException e) {
                 log.warn("文件流关闭失败",e);
             }
             try {
-                fis.close();
+                if (fis != null) {
+                    fis.close();
+                }
             } catch (IOException e) {
                 log.warn("文件流关闭失败",e);
             }