Commit e9e0ccf5 by 111-PC\111

[+]设备导入修改

1 parent 26bd3c72
......@@ -24,6 +24,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@Service
......@@ -109,10 +110,17 @@ public class DeviceMgrServiceImpl implements DeviceMgrService {
errorMessagelist.add("第" + rownum + "行设备号为空");
continue;
}else{
PlatformDevice platformDevice=deviceMapper.findBySn(deviceSn);
if(platformDevice!=null){
errorMessagelist.add("设备号" + deviceSn +"已经在库里面存在");
String regex = "^(10|20|31|32|33|34)([0-9]{10,10})";
Pattern compile = Pattern.compile(regex);
if(!compile.matcher(deviceSn).matches()){
errorMessagelist.add("设备号" + deviceSn + "校验不通过");
continue;
}else {
PlatformDevice platformDevice = deviceMapper.findBySn(deviceSn);
if (platformDevice != null) {
errorMessagelist.add("设备号" + deviceSn + "已经在库里面存在");
continue;
}
}
}
if (StringUtils.isNullOrEmpty(deviceType)) {
......@@ -154,4 +162,5 @@ public class DeviceMgrServiceImpl implements DeviceMgrService {
private Date getStatisticEndTime() {
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!