Commit bdf11dee authored by maoying's avatar maoying

处理iotcode为空

parent 33bfd3f1
......@@ -2531,7 +2531,7 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
EquipmentSpecificIndex equipmentSpecificIndex = new EquipmentSpecificIndex();
String prefix = null;
String suffix = null;
if (iotCode.length() > 8) {
if (!StringUtils.isEmpty(iotCode) && iotCode.length() > 8) {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
......
......@@ -4,6 +4,8 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import liquibase.util.StringUtil;
import java.util.HashSet;
import java.util.Set;
......@@ -33,6 +35,11 @@ public class BeanUtil {
public static boolean judgePropertyContainsChar(String sourceStr, String specialStr) {
boolean bool = Boolean.FALSE;
if(StringUtil.isEmpty(sourceStr) || StringUtil.isEmpty(specialStr)){
return bool;
}
specialStr = specialStr.trim();
sourceStr = sourceStr.trim();
String[] strings = specialStr.split(",");
for (String code : strings) {
if (sourceStr.contains(code)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment