|
@@ -111,7 +111,7 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
throw new BusinessException(ResultCode.WIFI_NAME_ERROR);
|
|
|
}
|
|
|
LambdaQueryWrapper<Camera> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.eq(Camera::getWifiName,wifiName);
|
|
|
+ wrapper.eq(Camera::getSnCode,wifiName.split("_")[1]);
|
|
|
long count = this.count(wrapper);
|
|
|
if(count > 0){
|
|
|
throw new BusinessException(ResultCode.WIFI_NAME_REPEAT);
|
|
@@ -174,12 +174,16 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
public Integer ins(List<String> wifiNameList){
|
|
|
List<Integer> errorRow = getErrorRow(wifiNameList);
|
|
|
excelService.toExcelError(errorRow);
|
|
|
+ List<String> snCodeList = new ArrayList<>();
|
|
|
+ for (String wifiName : wifiNameList) {
|
|
|
+ snCodeList.add(wifiName.split("_")[1]);
|
|
|
+ }
|
|
|
LambdaQueryWrapper<Camera> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.in(Camera::getWifiName,wifiNameList);
|
|
|
+ wrapper.in(Camera::getSnCode,snCodeList);
|
|
|
List<Camera> list = this.list(wrapper);
|
|
|
if(list.size() >0){
|
|
|
- List<String> newList = list.parallelStream().map(Camera::getWifiName).collect(Collectors.toList());
|
|
|
- List<Integer> errorRow2 = getErrorRow(wifiNameList, newList);
|
|
|
+ List<String> newList = list.parallelStream().map(Camera::getSnCode).collect(Collectors.toList());
|
|
|
+ List<Integer> errorRow2 = getErrorRow(snCodeList, newList);
|
|
|
excelService.toExcelError(errorRow2);
|
|
|
}
|
|
|
return saveBatchCamera(wifiNameList);
|