|
@@ -160,7 +160,7 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
}
|
|
}
|
|
@Override
|
|
@Override
|
|
public Integer ins(List<String> wifiNameList){
|
|
public Integer ins(List<String> wifiNameList){
|
|
- List<Integer> errorRow = getErrorRow(wifiNameList, null);
|
|
|
|
|
|
+ List<Integer> errorRow = getErrorRow(wifiNameList);
|
|
getResultIn(errorRow);
|
|
getResultIn(errorRow);
|
|
LambdaQueryWrapper<Camera> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Camera> wrapper = new LambdaQueryWrapper<>();
|
|
wrapper.in(Camera::getWifiName,wifiNameList);
|
|
wrapper.in(Camera::getWifiName,wifiNameList);
|
|
@@ -186,22 +186,39 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
throw new BusinessException(-1, res.toString());
|
|
throw new BusinessException(-1, res.toString());
|
|
}
|
|
}
|
|
|
|
|
|
- private List<Integer> getErrorRow(List<String> wifiNameList, List<String> newList){
|
|
|
|
|
|
+ private List<Integer> getErrorRow(List<String> wifiNameList){
|
|
List<Integer> errorIndexList = new ArrayList<>();
|
|
List<Integer> errorIndexList = new ArrayList<>();
|
|
- boolean bo = false;
|
|
|
|
- if(newList == null){
|
|
|
|
- newList = wifiNameList;
|
|
|
|
- bo = true;
|
|
|
|
- }
|
|
|
|
- for (String wifiName : newList) {
|
|
|
|
- int index = wifiNameList.indexOf(wifiName) + 4;
|
|
|
|
- if(bo){
|
|
|
|
- if( !wifiName.contains("_") || !wifiName.contains("4D")
|
|
|
|
- || !CameraTypeEnum.typePrefixMap.containsKey(wifiName.split("_")[0]+"_")){
|
|
|
|
- errorIndexList.add(index);
|
|
|
|
- }
|
|
|
|
- }else {
|
|
|
|
|
|
+ Set<String> wifiNameSet = new HashSet<>();
|
|
|
|
+ Integer index = 3;
|
|
|
|
+ for (String wifiName : wifiNameList) {
|
|
|
|
+ index ++;
|
|
|
|
+ if(StringUtils.isBlank(wifiName)){
|
|
|
|
+ errorIndexList.add(index);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if(wifiNameSet.contains(wifiName)){
|
|
errorIndexList.add(index);
|
|
errorIndexList.add(index);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if( !wifiName.contains("_") || !wifiName.contains("4D")
|
|
|
|
+ || !CameraTypeEnum.typePrefixMap.containsKey(wifiName.split("_")[0]+"_")){
|
|
|
|
+ errorIndexList.add(index);
|
|
|
|
+ }
|
|
|
|
+ wifiNameSet.add(wifiName);
|
|
|
|
+ }
|
|
|
|
+ return errorIndexList;
|
|
|
|
+ }
|
|
|
|
+ private List<Integer> getErrorRow(List<String> wifiNameList,List<String> dbList){
|
|
|
|
+ List<Integer> errorIndexList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ if(dbList.size() <=0){
|
|
|
|
+ return errorIndexList;
|
|
|
|
+ }
|
|
|
|
+ Integer index = 3;
|
|
|
|
+ for (String wifiName : wifiNameList) {
|
|
|
|
+ index ++;
|
|
|
|
+ if(dbList.contains(wifiName)){
|
|
|
|
+ errorIndexList.add(index);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return errorIndexList;
|
|
return errorIndexList;
|
|
@@ -265,6 +282,9 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
private void checkSnCode(List<String> snCodeList) {
|
|
private void checkSnCode(List<String> snCodeList) {
|
|
HashMap<String,Integer> map = new HashMap<>();
|
|
HashMap<String,Integer> map = new HashMap<>();
|
|
for (String snCode : snCodeList) {
|
|
for (String snCode : snCodeList) {
|
|
|
|
+ if(StringUtils.isBlank(snCode)){
|
|
|
|
+ map.put(snCode,2);
|
|
|
|
+ }
|
|
if(map.get(snCode) == null){
|
|
if(map.get(snCode) == null){
|
|
map.put(snCode,1);
|
|
map.put(snCode,1);
|
|
}else {
|
|
}else {
|