|
@@ -216,14 +216,17 @@ public class CameraServiceImpl extends ServiceImpl<ICameraMapper, Camera> implem
|
|
|
|
|
|
@Override
|
|
|
public void out(CameraInOutParam param) {
|
|
|
- if(param.getOutType() == null || param.getCompanyName() == null || param.getId() == null){
|
|
|
+ if(param.getOutType() == null || param.getId() == null){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
- Company company = companyService.getCompanyByName(param.getCompanyName());
|
|
|
- if(company == null){
|
|
|
- throw new BusinessException(ResultCode.COMPANY_NAME_NOT_EXIST);
|
|
|
+ if(StringUtils.isNotBlank(param.getCompanyName())){
|
|
|
+ Company company = companyService.getCompanyByName(param.getCompanyName());
|
|
|
+ if(company == null){
|
|
|
+ throw new BusinessException(ResultCode.COMPANY_NAME_NOT_EXIST);
|
|
|
+ }
|
|
|
+ param.setCompanyId(company.getId());
|
|
|
}
|
|
|
- param.setCompanyId(company.getId());
|
|
|
+
|
|
|
Camera camera = this.getById(param.getId());
|
|
|
if(camera == null){
|
|
|
throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
|