Commit e9e0ccf5 by 111-PC\111

[+]设备导入修改

1 parent 26bd3c72
...@@ -24,6 +24,7 @@ import java.util.Date; ...@@ -24,6 +24,7 @@ import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -109,10 +110,17 @@ public class DeviceMgrServiceImpl implements DeviceMgrService { ...@@ -109,10 +110,17 @@ public class DeviceMgrServiceImpl implements DeviceMgrService {
errorMessagelist.add("第" + rownum + "行设备号为空"); errorMessagelist.add("第" + rownum + "行设备号为空");
continue; continue;
}else{ }else{
PlatformDevice platformDevice=deviceMapper.findBySn(deviceSn); String regex = "^(10|20|31|32|33|34)([0-9]{10,10})";
if(platformDevice!=null){ Pattern compile = Pattern.compile(regex);
errorMessagelist.add("设备号" + deviceSn +"已经在库里面存在"); if(!compile.matcher(deviceSn).matches()){
errorMessagelist.add("设备号" + deviceSn + "校验不通过");
continue; continue;
}else {
PlatformDevice platformDevice = deviceMapper.findBySn(deviceSn);
if (platformDevice != null) {
errorMessagelist.add("设备号" + deviceSn + "已经在库里面存在");
continue;
}
} }
} }
if (StringUtils.isNullOrEmpty(deviceType)) { if (StringUtils.isNullOrEmpty(deviceType)) {
...@@ -154,4 +162,5 @@ public class DeviceMgrServiceImpl implements DeviceMgrService { ...@@ -154,4 +162,5 @@ public class DeviceMgrServiceImpl implements DeviceMgrService {
private Date getStatisticEndTime() { private Date getStatisticEndTime() {
return DateUtil.beginOfDay(new Date()); return DateUtil.beginOfDay(new Date());
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!