|
|
@@ -1,11 +1,15 @@
|
|
|
package com.sckw.fleet.dubbo;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.sckw.core.common.enums.enums.ErrorCodeEnum;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
+import com.sckw.core.exception.BusinessPlatfromException;
|
|
|
import com.sckw.core.model.constant.Global;
|
|
|
import com.sckw.core.utils.BeanUtils;
|
|
|
import com.sckw.core.utils.CollectionUtils;
|
|
|
import com.sckw.core.utils.StringUtils;
|
|
|
+import com.sckw.core.web.context.LoginUserHolder;
|
|
|
+import com.sckw.core.web.response.HttpResult;
|
|
|
import com.sckw.fleet.api.RemoteFleetService;
|
|
|
import com.sckw.fleet.api.model.dto.RUpdateDriverScoreDto;
|
|
|
import com.sckw.fleet.api.model.vo.*;
|
|
|
@@ -17,6 +21,7 @@ import com.sckw.fleet.service.KwfDriverScoreService;
|
|
|
import com.sckw.fleet.service.KwfDriverService;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.apache.dubbo.config.annotation.DubboService;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
@@ -34,6 +39,7 @@ import java.util.stream.Collectors;
|
|
|
@DubboService(group = "design", version = "1.0.0")
|
|
|
@Service
|
|
|
@RequiredArgsConstructor
|
|
|
+@Slf4j
|
|
|
public class RemoteFleetServiceImpl implements RemoteFleetService {
|
|
|
|
|
|
@Autowired
|
|
|
@@ -57,6 +63,7 @@ public class RemoteFleetServiceImpl implements RemoteFleetService {
|
|
|
private final KwfDriverScoreRepository driverScoreRepository;
|
|
|
private final KwfDriverScoreService driverScoreService;
|
|
|
private final KwfDriverService driverService;
|
|
|
+ private final KwfTruckReportRepository truckReportRepository;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -624,7 +631,23 @@ public class RemoteFleetServiceImpl implements RemoteFleetService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void driverBindTruck(Long driverId, Long truckId) {
|
|
|
- driverService.bindTruck(driverId, truckId);
|
|
|
+ public void driverBindTruck(Long driverId, Long truckId,Long entId) {
|
|
|
+ driverService.bindTruck(driverId, truckId,entId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void unbindTruck(Long entId, Long driverId) {
|
|
|
+ KwfTruckReport truckReport = truckReportRepository.getOne(Wrappers.<KwfTruckReport>lambdaQuery()
|
|
|
+ .eq(KwfTruckReport::getEntId, LoginUserHolder.getEntId())
|
|
|
+ .eq(KwfTruckReport::getDriverId, driverId)
|
|
|
+ .eq(KwfTruckReport::getDelFlag, Global.NO)
|
|
|
+ .eq(KwfTruckReport::getStatus, Global.YES));
|
|
|
+ if(truckReport == null) {
|
|
|
+ throw new BusinessPlatfromException(ErrorCodeEnum.WAYBILL_ORDER_STATUS_ERROR, "此司机无车辆解绑信息!");
|
|
|
+ }
|
|
|
+ truckReport.setStatus(Global.NO);
|
|
|
+ log.info("pc端解绑车辆请求参数 :{}", truckReport);
|
|
|
+ truckReportRepository.updateById(truckReport);
|
|
|
+
|
|
|
}
|
|
|
}
|