|
@@ -20,6 +20,7 @@ import com.fdkankan.reg.dto.CamRegDto;
|
|
import com.fdkankan.reg.dto.CamRegSDto;
|
|
import com.fdkankan.reg.dto.CamRegSDto;
|
|
import com.fdkankan.reg.dto.MachineRegDto;
|
|
import com.fdkankan.reg.dto.MachineRegDto;
|
|
import jdk.internal.dynalink.linker.LinkerServices;
|
|
import jdk.internal.dynalink.linker.LinkerServices;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -36,6 +37,7 @@ import java.util.stream.Collectors;
|
|
* @since 2023-07-07
|
|
* @since 2023-07-07
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
|
|
+@Slf4j
|
|
public class AuthorizeCameraServiceImpl extends ServiceImpl<IAuthorizeCameraMapper, AuthorizeCamera> implements IAuthorizeCameraService {
|
|
public class AuthorizeCameraServiceImpl extends ServiceImpl<IAuthorizeCameraMapper, AuthorizeCamera> implements IAuthorizeCameraService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -112,6 +114,9 @@ public class AuthorizeCameraServiceImpl extends ServiceImpl<IAuthorizeCameraMapp
|
|
throw new BusinessException(ResultCode.CAMERA_SN_EXITS);
|
|
throw new BusinessException(ResultCode.CAMERA_SN_EXITS);
|
|
}
|
|
}
|
|
for (String snCode : split) {
|
|
for (String snCode : split) {
|
|
|
|
+ if(StringUtils.isBlank(snCode)){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
snCode = snCode.toUpperCase();
|
|
snCode = snCode.toUpperCase();
|
|
CamRegDto camRegDto = new CamRegDto();
|
|
CamRegDto camRegDto = new CamRegDto();
|
|
camRegDto.setSn(snCode);
|
|
camRegDto.setSn(snCode);
|
|
@@ -140,19 +145,14 @@ public class AuthorizeCameraServiceImpl extends ServiceImpl<IAuthorizeCameraMapp
|
|
}
|
|
}
|
|
param.setAuthorizeKey(authorizeKey);
|
|
param.setAuthorizeKey(authorizeKey);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
|
+ log.info("授权相机:error:",e);
|
|
throw new BusinessException(ResultCode.GET_MACHINE_CODE_ERROR);
|
|
throw new BusinessException(ResultCode.GET_MACHINE_CODE_ERROR);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.saveOrUpdate(param);
|
|
this.saveOrUpdate(param);
|
|
- if(StringUtils.isNotBlank(param.getSnCodes())){
|
|
|
|
- String[] split = param.getSnCodes().split("\n");
|
|
|
|
- for (String snCode : split) {
|
|
|
|
- AuthorizeCameraDetail detail = detailHashMap.get(snCode);
|
|
|
|
- if(detail!= null){
|
|
|
|
- detail.setAuthorizeCameraId(param.getId());
|
|
|
|
- authorizeCameraDetailService.save(detail);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ for (AuthorizeCameraDetail detail : detailHashMap.values()) {
|
|
|
|
+ detail.setAuthorizeCameraId(param.getId());
|
|
|
|
+ authorizeCameraDetailService.save(detail);
|
|
}
|
|
}
|
|
return param;
|
|
return param;
|
|
}
|
|
}
|