|
@@ -2,6 +2,7 @@ package com.fdkankan.manage.service.impl;
|
|
|
|
|
|
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fdkankan.common.constant.Constant;
|
|
@@ -21,6 +22,7 @@ import com.fdkankan.manage.service.*;
|
|
|
import com.fdkankan.manage.util.Dateutils;
|
|
|
import com.fdkankan.manage.vo.request.CameraInOutParam;
|
|
|
import com.fdkankan.manage.vo.request.CameraParam;
|
|
|
+import com.fdkankan.manage.vo.response.CameraDataVo;
|
|
|
import com.fdkankan.manage.vo.response.CameraDetailVo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -314,22 +316,28 @@ IOrderService orderService;
|
|
|
if(cameraDetail == null){
|
|
|
throw new BusinessException(ResultCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
}
|
|
|
+ LambdaUpdateWrapper<CameraDetail> wrapper = new LambdaUpdateWrapper<>();
|
|
|
+ wrapper.eq(CameraDetail::getId,cameraDetail.getId());
|
|
|
if(StringUtils.isNotBlank(param.getCompanyName())){
|
|
|
Company company = companyService.getCompanyByName(param.getCompanyName());
|
|
|
if(company == null){
|
|
|
throw new BusinessException(ResultCode.COMPANY_NAME_NOT_EXIST);
|
|
|
}
|
|
|
- cameraDetail.setCompanyId(company.getId());
|
|
|
+ wrapper.set(CameraDetail::getCompanyId,company.getId());
|
|
|
+ }else {
|
|
|
+ wrapper.set(CameraDetail::getCompanyId,null);
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(param.getOrderSn())){
|
|
|
Order orderSn = orderService.getByOrderSn(param.getOrderSn());
|
|
|
if(orderSn == null ){
|
|
|
throw new BusinessException(ResultCode.ORDER_SN_ERROR);
|
|
|
}
|
|
|
- cameraDetail.setOrderSn(param.getOrderSn());
|
|
|
+ wrapper.set(CameraDetail::getOrderSn,orderSn.getOrderSn());
|
|
|
+ }else {
|
|
|
+ wrapper.set(CameraDetail::getOrderSn,null);
|
|
|
}
|
|
|
- cameraDetail.setOwn(param.getOutType());
|
|
|
- cameraDetailService.updateById(cameraDetail);
|
|
|
+ wrapper.set(CameraDetail::getOwn,param.getOutType());
|
|
|
+ cameraDetailService.update(wrapper);
|
|
|
}
|
|
|
|
|
|
@Override
|