From d07553f8cfdc4ce407122f905b49191b8ffbc7fb Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Wed, 27 Dec 2017 10:19:18 +0800 Subject: [PATCH] Merge branch 'master' of ssh://blit.7drlb.com:29418/screen_api_v2 --- /dev/null | 55 --------------------------- src/main/java/com/moral/common/util/ExampleUtil.java | 5 +- src/main/java/com/moral/common/util/StringUtils.java | 1 3 files changed, 2 insertions(+), 59 deletions(-) diff --git a/src/main/java/com/moral/common/util/ExampleUtil.java b/src/main/java/com/moral/common/util/ExampleUtil.java index d50d02a..3fe825c 100644 --- a/src/main/java/com/moral/common/util/ExampleUtil.java +++ b/src/main/java/com/moral/common/util/ExampleUtil.java @@ -22,6 +22,7 @@ public static Example generateExample(Class clzz, String params) { Example example = new Example(clzz); try { + if(StringUtils.isNullOrEmpty(params)){ return example;} params = URLDecoder.decode(params, "UTF-8"); if (!StringUtils.isNullOrEmpty(params) && params.startsWith("or|")) { String[] criteria = params.trim().split(OR_SPLIT); @@ -41,10 +42,8 @@ if (method != null && isPropertyOfClass(clzz, propertyName)) { List values = new ArrayList<Object>(); if (conditionItems.length > 2) { - //��������������� - Class<?> valutType = new PropertyDescriptor(propertyName, clzz).getPropertyType(); for (int index = 2; index < conditionItems.length; index++) { - values.add(StringUtils.stringToObject4Type(valutType, conditionItems[index])); + values.add(conditionItems[index]); } } invokeMethod(criteriaOfExample,method,propertyName,values); diff --git a/src/main/java/com/moral/common/util/StringUtils.java b/src/main/java/com/moral/common/util/StringUtils.java index 4b2791b..670a2c2 100644 --- a/src/main/java/com/moral/common/util/StringUtils.java +++ b/src/main/java/com/moral/common/util/StringUtils.java @@ -48,7 +48,6 @@ } public static Object stringToObject4Type(Class<?> type,String value) throws Exception{ Object result = value; - if (type == double.class || type == Double.class) { result = Double.parseDouble(value); } else if (type == float.class || type == Float.class) { diff --git a/src/main/java/com/moral/entity/DeviceVersion.java.1 b/src/main/java/com/moral/entity/DeviceVersion.java.1 deleted file mode 100644 index d8633f0..0000000 --- a/src/main/java/com/moral/entity/DeviceVersion.java.1 +++ /dev/null @@ -1,55 +0,0 @@ -package com.moral.entity; - -import java.util.Date; - -public class DeviceVersion { - private Integer id; - - private String name; - - private Integer version; - - private Date createTime; - - private String description; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } -} \ No newline at end of file diff --git a/src/main/java/com/moral/entity/DeviceVersion.java.2 b/src/main/java/com/moral/entity/DeviceVersion.java.2 deleted file mode 100644 index d8633f0..0000000 --- a/src/main/java/com/moral/entity/DeviceVersion.java.2 +++ /dev/null @@ -1,55 +0,0 @@ -package com.moral.entity; - -import java.util.Date; - -public class DeviceVersion { - private Integer id; - - private String name; - - private Integer version; - - private Date createTime; - - private String description; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } -} \ No newline at end of file diff --git a/src/main/java/com/moral/entity/DeviceVersion.java.3 b/src/main/java/com/moral/entity/DeviceVersion.java.3 deleted file mode 100644 index d8633f0..0000000 --- a/src/main/java/com/moral/entity/DeviceVersion.java.3 +++ /dev/null @@ -1,55 +0,0 @@ -package com.moral.entity; - -import java.util.Date; - -public class DeviceVersion { - private Integer id; - - private String name; - - private Integer version; - - private Date createTime; - - private String description; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } -} \ No newline at end of file diff --git a/src/main/java/com/moral/entity/DeviceVersion.java.4 b/src/main/java/com/moral/entity/DeviceVersion.java.4 deleted file mode 100644 index d8633f0..0000000 --- a/src/main/java/com/moral/entity/DeviceVersion.java.4 +++ /dev/null @@ -1,55 +0,0 @@ -package com.moral.entity; - -import java.util.Date; - -public class DeviceVersion { - private Integer id; - - private String name; - - private Integer version; - - private Date createTime; - - private String description; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getVersion() { - return version; - } - - public void setVersion(Integer version) { - this.version = version; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } -} \ No newline at end of file -- Gitblit v1.8.0