|
|
@@ -10,7 +10,6 @@ import com.qtzl.alterSales.dao.entity.second.AflVehicleStatusInfo; |
|
|
|
import com.qtzl.alterSales.dao.repo.jpa.primary.AflBindInfoRepo; |
|
|
|
import com.qtzl.alterSales.dao.repo.jpa.primary.FssPaccountPayRepo; |
|
|
|
import com.qtzl.alterSales.dao.repo.jpa.second.AflCenterVehicleInfoRepo; |
|
|
|
import com.qtzl.alterSales.dao.repo.jpa.second.AflTokenRepo; |
|
|
|
import com.qtzl.alterSales.dao.repo.jpa.second.AflVehicleStatusHisInfoRepo; |
|
|
|
import com.qtzl.alterSales.dao.repo.jpa.second.AflVehicleStatusInfoRepo; |
|
|
|
import com.qtzl.alterSales.manager.enums.BlacklistOpType; |
|
|
@@ -26,7 +25,6 @@ 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; |
|
|
@@ -54,8 +52,6 @@ public class AflVehicleStatusInfoServiceImpl implements AflVehicleStatusInfoSer |
|
|
|
@Resource |
|
|
|
private FssBlackListManager fssBlackListManager; |
|
|
|
@Resource |
|
|
|
private AflTokenRepo aflTokenRepo; |
|
|
|
@Resource |
|
|
|
SendCenterService sendCenterService; |
|
|
|
|
|
|
|
@Override |
|
|
@@ -64,14 +60,15 @@ public class AflVehicleStatusInfoServiceImpl implements AflVehicleStatusInfoSer |
|
|
|
isParamCheck(request); |
|
|
|
AflVehicleStatusInfo aflVehicleStatusInfo = aflVehicleStatusInfoRepo.findByVehicleIdAndCardIdAndObuId(request.getVehicleId(),request.getCpuId(),request.getObuId()); |
|
|
|
Boolean flash = true; |
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"); |
|
|
|
log.info("操作状态名单-查询状态名单记录为{}",JSON.toJSON(aflVehicleStatusInfo)); |
|
|
|
if (aflVehicleStatusInfo!=null){ |
|
|
|
flash=false; |
|
|
|
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(); |
|
|
|
// Duration dur= Duration.between(aflVehicleStatusInfo.getUpdateTime(), LocalDateTime.now() ); |
|
|
|
// long minute = dur.toMinutes(); |
|
|
|
// //5分钟内不允许操作 |
|
|
|
// long minMinute=5L; |
|
|
|
// if (minute<minMinute){ |
|
|
@@ -85,7 +82,19 @@ public class AflVehicleStatusInfoServiceImpl implements AflVehicleStatusInfoSer |
|
|
|
aflVehicleStatusInfo=new AflVehicleStatusInfo(); |
|
|
|
} |
|
|
|
BeanUtils.copyProperties(request,aflVehicleStatusInfo); |
|
|
|
aflVehicleStatusInfo.setCreateTime(LocalDateTime.now()); |
|
|
|
if (StringUtils.isEmpty(request.getCreateTime()) ){ |
|
|
|
aflVehicleStatusInfo.setCreateTime(LocalDateTime.now()); |
|
|
|
}else { |
|
|
|
LocalDateTime createTime = null; |
|
|
|
try { |
|
|
|
createTime = LocalDateTime.parse(request.getCreateTime(), formatter); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("操作状态名单-转换时间异常,时间为{}",request.getCreateTime()); |
|
|
|
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("状态名单生成时间格式有误,格式应为yyyy-MM-ddTHH:mm:ss"); |
|
|
|
} |
|
|
|
aflVehicleStatusInfo.setCreateTime(createTime); |
|
|
|
} |
|
|
|
|
|
|
|
if (flash){ |
|
|
|
AflBindInfo aflBindInfo = aflBindInfoRepo.findByVehicleId(request.getVehicleId()); |
|
|
|
log.info("操作状态名单-查询车辆绑定记录为{}",JSON.toJSON(aflBindInfo)); |
|
|
@@ -120,7 +129,7 @@ public class AflVehicleStatusInfoServiceImpl implements AflVehicleStatusInfoSer |
|
|
|
log.info("操作状态名单-查询状态名单记录为{}",JSON.toJSON(aflVehicleStatusInfo)); |
|
|
|
VehicleBlackListRequest vehicleBlackListRequest = new VehicleBlackListRequest(); |
|
|
|
BeanUtils.copyProperties(request,vehicleBlackListRequest); |
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss"); |
|
|
|
|
|
|
|
vehicleBlackListRequest.setCreateTime(aflVehicleStatusInfo.getCreateTime().format(formatter)); |
|
|
|
boolean implement; |
|
|
|
try { |