|
|
@@ -26,9 +26,11 @@ import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.time.Duration; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.List; |
|
|
|
import java.util.UUID; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
@@ -68,13 +70,21 @@ public class AflVehicleStatusInfoServiceImpl implements AflVehicleStatusInfoSer |
|
|
|
if (request.getType().equals(aflVehicleStatusInfo.getType())){ |
|
|
|
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("当为状态已为"+ BlacklistOpType.findByCode(request.getType()).getValue()); |
|
|
|
} |
|
|
|
Duration dur= Duration.between(aflVehicleStatusInfo.getUpdateTime(), LocalDateTime.now() ); |
|
|
|
long minute = dur.toMinutes(); |
|
|
|
// //5分钟内不允许操作 |
|
|
|
// long minMinute=5L; |
|
|
|
// if (minute<minMinute){ |
|
|
|
// throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("5分钟内不允许进行操作"); |
|
|
|
// } |
|
|
|
AflVehicleStatusHisInfo aflVehicleStatusHisInfo = new AflVehicleStatusHisInfo(); |
|
|
|
BeanUtils.copyProperties(aflVehicleStatusInfo,aflVehicleStatusHisInfo); |
|
|
|
aflVehicleStatusHisInfo.setId(UUID.randomUUID().toString().replace("-", "")); |
|
|
|
aflVehicleStatusHisInfoRepo.save(aflVehicleStatusHisInfo); |
|
|
|
}else{ |
|
|
|
aflVehicleStatusInfo=new AflVehicleStatusInfo(); |
|
|
|
BeanUtils.copyProperties(request,aflVehicleStatusInfo); |
|
|
|
} |
|
|
|
BeanUtils.copyProperties(request,aflVehicleStatusInfo); |
|
|
|
aflVehicleStatusInfo.setCreateTime(LocalDateTime.now()); |
|
|
|
if (flash){ |
|
|
|
AflBindInfo aflBindInfo = aflBindInfoRepo.findByVehicleId(request.getVehicleId()); |
|
|
@@ -162,6 +172,7 @@ public class AflVehicleStatusInfoServiceImpl implements AflVehicleStatusInfoSer |
|
|
|
log.error("下黑或返白时,需指定uniqueKey..."); |
|
|
|
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("下黑或返白时,需指定uniqueKey..."); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |