|
|
@@ -1,36 +1,36 @@
|
|
|
package com.sckw.transport.service;
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
-import com.github.pagehelper.PageInfo;
|
|
|
-import com.sckw.core.common.enums.enums.DictTypeEnum;
|
|
|
import com.sckw.core.model.constant.Global;
|
|
|
import com.sckw.core.model.enums.CarWaybillEnum;
|
|
|
import com.sckw.core.model.enums.LogisticsOrderEnum;
|
|
|
-import com.sckw.core.model.page.PageHelperUtil;
|
|
|
import com.sckw.core.model.page.PageResult;
|
|
|
import com.sckw.core.utils.*;
|
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
|
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.vo.RDriverVo;
|
|
|
+import com.sckw.fleet.api.model.vo.RTruckVo;
|
|
|
import com.sckw.mongo.enums.BusinessTypeEnum;
|
|
|
import com.sckw.mongo.model.SckwLogisticsOrder;
|
|
|
import com.sckw.mongo.model.SckwWaybillOrder;
|
|
|
import com.sckw.stream.model.SckwBusSum;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.model.dto.res.EntCacheResDto;
|
|
|
-import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
-import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
|
import com.sckw.transport.dao.*;
|
|
|
import com.sckw.transport.model.*;
|
|
|
import com.sckw.transport.model.dto.*;
|
|
|
import com.sckw.transport.model.vo.WaybillCountVo;
|
|
|
import com.sckw.transport.model.vo.WaybillOrderDriverVo;
|
|
|
import jakarta.annotation.Resource;
|
|
|
+import jakarta.validation.Valid;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.cloud.stream.function.StreamBridge;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
|
@@ -42,6 +42,7 @@ import java.util.stream.Collectors;
|
|
|
* @date 2023/7/19 0019
|
|
|
*/
|
|
|
@Service
|
|
|
+@SuppressWarnings("all")
|
|
|
public class KwtWaybillOrderService {
|
|
|
|
|
|
@Autowired
|
|
|
@@ -68,7 +69,8 @@ public class KwtWaybillOrderService {
|
|
|
private StreamBridge streamBridge;
|
|
|
@DubboReference(version = "2.0.0", group = "design", check = false)
|
|
|
private RemoteSystemService remoteSystemService;
|
|
|
-
|
|
|
+ @DubboReference(version = "1.0.0", group = "design", check = false)
|
|
|
+ private RemoteFleetService remoteFleetService;
|
|
|
|
|
|
/**
|
|
|
* @param driverId 司机ID
|
|
|
@@ -130,7 +132,152 @@ public class KwtWaybillOrderService {
|
|
|
return waybillOrders;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param params
|
|
|
+ * @desc 变更司机
|
|
|
+ * @author zk
|
|
|
+ * @date 2023/8/2
|
|
|
+ **/
|
|
|
+ public HttpResult changeDriver(@RequestBody @Valid ChangeDriverDto params){
|
|
|
+ /**数据校验**/
|
|
|
+ SckwWaybillOrder wOrder = new SckwWaybillOrder();
|
|
|
+ //车辆运单信息
|
|
|
+ KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(params.getWOrderId());
|
|
|
+ //循环派车信息
|
|
|
+ KwtLogisticsOrderCirculate circulate = logisticsOrderCirculateDao.selectById(params.getWOrderId());
|
|
|
+ if (waybillOrder == null && circulate == null) {
|
|
|
+ return HttpResult.error("车辆运单不存在!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**循环派车**/
|
|
|
+ if (params.getType() == Global.NUMERICAL_TWO) {
|
|
|
+ /**更新循环派车信息**/
|
|
|
+ if (circulate != null) {
|
|
|
+ changeWaybillOrderCirculate(circulate.getId(), params, null);
|
|
|
+ wOrder.set_id(circulate.getId());
|
|
|
+ } else {
|
|
|
+ circulate = logisticsOrderCirculateDao.findCirculate(waybillOrder.getLOrderId(), waybillOrder.getTruckId(), waybillOrder.getDriverId(), Global.NO);
|
|
|
+ changeWaybillOrderCirculate(circulate.getId(), params, null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (waybillOrder != null) {
|
|
|
+ if (!CarWaybillEnum.changeDriverAndTruck(waybillOrder.getStatus())) {
|
|
|
+ return HttpResult.error("车辆运单当前状态不能变更司机!");
|
|
|
+ }
|
|
|
+ /**更新车辆运单**/
|
|
|
+ changeWaybillOrder(params, null);
|
|
|
+ wOrder.set_id(params.getWOrderId());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**Mongodb数据更新**/
|
|
|
+ wOrder.setDriverId(params.getDriverId());
|
|
|
+ wOrder.setDriverName(params.getDriverName());
|
|
|
+ wOrder.setDriverPhone(params.getDriverPhone());
|
|
|
+ wOrder.setDriverIdcard(params.getDriverIdcard());
|
|
|
+ editSckwWaybillOrder(wOrder, waybillOrder, 2);
|
|
|
+ return HttpResult.ok("更换司机成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param params
|
|
|
+ * @desc 变更车辆
|
|
|
+ * @author zk
|
|
|
+ * @date 2023/8/2
|
|
|
+ **/
|
|
|
+ public HttpResult changeTruck(@RequestBody @Valid ChangeTruckDto params){
|
|
|
+ /**数据校验**/
|
|
|
+ SckwWaybillOrder wOrder = new SckwWaybillOrder();
|
|
|
+ //车辆运单信息
|
|
|
+ KwtWaybillOrder waybillOrder = waybillOrderDao.selectById(params.getWOrderId());
|
|
|
+ //循环派车信息
|
|
|
+ KwtLogisticsOrderCirculate circulate = logisticsOrderCirculateDao.selectById(params.getWOrderId());
|
|
|
+ if (waybillOrder == null && circulate == null) {
|
|
|
+ return HttpResult.error("车辆运单不存在!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**循环派车**/
|
|
|
+ if (params.getType() == Global.NUMERICAL_TWO) {
|
|
|
+ /**更新循环派车信息**/
|
|
|
+ if (circulate != null) {
|
|
|
+ changeWaybillOrderCirculate(circulate.getId(), null, params);
|
|
|
+ wOrder.set_id(circulate.getId());
|
|
|
+ } else {
|
|
|
+ circulate = logisticsOrderCirculateDao.findCirculate(waybillOrder.getLOrderId(), waybillOrder.getTruckId(), waybillOrder.getDriverId(), Global.NO);
|
|
|
+ changeWaybillOrderCirculate(circulate.getId(), null, params);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (waybillOrder != null) {
|
|
|
+ if (!CarWaybillEnum.changeDriverAndTruck(waybillOrder.getStatus())) {
|
|
|
+ return HttpResult.error("车辆运单当前状态不能变更车辆!");
|
|
|
+ }
|
|
|
+ /**更新车辆运单**/
|
|
|
+ changeWaybillOrder(null, params);
|
|
|
+ wOrder.set_id(params.getWOrderId());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**Mongodb数据更新**/
|
|
|
+ wOrder.setTruckId(params.getTruckId());
|
|
|
+ wOrder.setTruckNo(params.getTruckNo());
|
|
|
+ wOrder.setTruckType(params.getTruckType());
|
|
|
+ wOrder.setTruckEnergyType(params.getTruckEnergyType());
|
|
|
+ wOrder.setTruckUseType(params.getTruckUseType());
|
|
|
+ wOrder.setTruckColor(params.getTruckColor());
|
|
|
+ wOrder.setTruckTrailerNo(params.getTruckTrailerNo());
|
|
|
+ editSckwWaybillOrder(wOrder, waybillOrder, 2);
|
|
|
+ return HttpResult.ok("更换车辆成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param circulateId 循环派车信息ID
|
|
|
+ * @param driver 司机信息
|
|
|
+ * @param truck 车辆信息
|
|
|
+ * @desc 变更循环派车信息
|
|
|
+ * @author zk
|
|
|
+ * @date 2023/8/2
|
|
|
+ **/
|
|
|
+ public void changeWaybillOrderCirculate(Long circulateId, ChangeDriverDto driver, ChangeTruckDto truck){
|
|
|
+ //循环派车信息
|
|
|
+ KwtLogisticsOrderCirculate circulate = new KwtLogisticsOrderCirculate();
|
|
|
+ if (driver != null) {
|
|
|
+ circulate.setId(circulateId);
|
|
|
+ circulate.setDriverId(driver.getDriverId());
|
|
|
+ circulate.setDriverPhone(driver.getDriverPhone());
|
|
|
+ circulate.setDriverName(driver.getDriverName());
|
|
|
+ circulate.setDriverIdcard(driver.getDriverIdcard());
|
|
|
+ }
|
|
|
+ if (truck != null) {
|
|
|
+ circulate.setTruckId(truck.getTruckId());
|
|
|
+ circulate.setTruckNo(truck.getTruckNo());
|
|
|
+ }
|
|
|
+ logisticsOrderCirculateDao.updateById(circulate);
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * @param driver 司机信息
|
|
|
+ * @param truck 车辆信息
|
|
|
+ * @desc 更新车辆运单信息
|
|
|
+ * @author zk
|
|
|
+ * @date 2023/8/2
|
|
|
+ **/
|
|
|
+ public void changeWaybillOrder(ChangeDriverDto driver, ChangeTruckDto truck){
|
|
|
+ //车辆运单信息
|
|
|
+ KwtWaybillOrder waybillOrder = new KwtWaybillOrder();
|
|
|
+ if (driver != null) {
|
|
|
+ waybillOrder.setId(driver.getWOrderId());
|
|
|
+ waybillOrder.setDriverId(driver.getDriverId());
|
|
|
+ waybillOrder.setDriverPhone(driver.getDriverPhone());
|
|
|
+ waybillOrder.setDriverName(driver.getDriverName());
|
|
|
+ waybillOrder.setDriverIdcard(driver.getDriverIdcard());
|
|
|
+ }
|
|
|
+ if (truck != null) {
|
|
|
+ waybillOrder.setId(truck.getWOrderId());
|
|
|
+ waybillOrder.setTruckId(truck.getTruckId());
|
|
|
+ waybillOrder.setTruckNo(truck.getTruckNo());
|
|
|
+ }
|
|
|
+ waybillOrderDao.updateById(waybillOrder);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -483,6 +630,7 @@ public class KwtWaybillOrderService {
|
|
|
order.setUnloadGrossAmount(new BigDecimal(Global.AMOUNT));
|
|
|
order.setUnloadUrls(Global.EMPTY_STRING);
|
|
|
order.setDeficitAmount(new BigDecimal(Global.AMOUNT));
|
|
|
+ order.setDeficitPrice(new BigDecimal(Global.AMOUNT));
|
|
|
order.setLoss(logisticsOrder.getLoss());
|
|
|
order.setLossUnit(logisticsOrder.getLossUnit());
|
|
|
order.setGoodsPrice(logisticsOrder.getGoodsPrice());
|
|
|
@@ -746,13 +894,19 @@ public class KwtWaybillOrderService {
|
|
|
/**2新增运单状态记录**/
|
|
|
setWaybillOrderTrack(waybillOrder.getId(), waybillOrder.getStatus(), params.getRemark());
|
|
|
|
|
|
- /**3Mongodb数据更新**/
|
|
|
+ /**3跟新司机/车辆数据**/
|
|
|
+ //更新司机信息
|
|
|
+ editDriver(waybillOrder.getDriverId());
|
|
|
+ //更新车辆信息
|
|
|
+ editTruck(waybillOrder.getTruckId());
|
|
|
+
|
|
|
+ /**4Mongodb数据更新**/
|
|
|
//1车辆运单
|
|
|
SckwWaybillOrder wOrder = new SckwWaybillOrder();
|
|
|
wOrder.set_id(waybillOrder.getId());
|
|
|
editSckwWaybillOrder(wOrder, waybillOrder, 2);
|
|
|
|
|
|
- /**4发送消息**/
|
|
|
+ /**5发送消息**/
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -1092,7 +1246,13 @@ public class KwtWaybillOrderService {
|
|
|
ticket.setTime(params.getTime());
|
|
|
waybillOrderTicketDao.insert(ticket);
|
|
|
|
|
|
- /**4更新承运订单entrustAmount**/
|
|
|
+ /**4跟新司机/车辆数据**/
|
|
|
+ //更新司机信息
|
|
|
+ editDriver(waybillOrder.getDriverId());
|
|
|
+ //更新车辆信息
|
|
|
+ editTruck(waybillOrder.getTruckId());
|
|
|
+
|
|
|
+ /**5更新承运订单entrustAmount**/
|
|
|
KwtLogisticsOrder logisticsOrder = logisticsOrderDao.selectById(waybillOrder.getLOrderId());
|
|
|
//承运订单已装货量=承运订单原装货量+当前车辆运单装货量
|
|
|
BigDecimal loadAmount = logisticsOrder.getLoadAmount() == null ? new BigDecimal(Global.AMOUNT) : logisticsOrder.getLoadAmount();
|
|
|
@@ -1103,7 +1263,7 @@ public class KwtWaybillOrderService {
|
|
|
//校验当前承运订单是否运输完成(修改状态+统计量)
|
|
|
checkLogisticsByStatusV1(waybillOrder.getLOrderId());
|
|
|
|
|
|
- /**5Mongodb数据更新**/
|
|
|
+ /**6Mongodb数据更新**/
|
|
|
//1车辆运单
|
|
|
SckwWaybillOrder wOrder = new SckwWaybillOrder();
|
|
|
wOrder.set_id(waybillOrder.getId());
|
|
|
@@ -1118,7 +1278,7 @@ public class KwtWaybillOrderService {
|
|
|
lOrder.setLoadAmount(logisticsOrder.getLoadAmount());
|
|
|
editSckwLogisticsOrder(lOrder, logisticsOrder);
|
|
|
|
|
|
- /**6发送消息**/
|
|
|
+ /**7发送消息**/
|
|
|
|
|
|
return HttpResult.ok("装货成功!");
|
|
|
}
|
|
|
@@ -1179,9 +1339,13 @@ public class KwtWaybillOrderService {
|
|
|
}
|
|
|
|
|
|
/**业务处理**/
|
|
|
+ KwtLogisticsOrder logisticsOrder = logisticsOrderDao.selectById(waybillOrder.getLOrderId());
|
|
|
/**1更新车辆运单**/
|
|
|
waybillOrder.setUnloadAmount(params.getAmount());
|
|
|
waybillOrder.setDeficitAmount(waybillOrder.getLoadAmount().subtract(waybillOrder.getUnloadAmount()));
|
|
|
+ BigDecimal deficitPrice = deficitPrice(waybillOrder.getLoadAmount(), waybillOrder.getDeficitAmount(),
|
|
|
+ logisticsOrder.getLoss(), logisticsOrder.getGoodsPrice());
|
|
|
+ waybillOrder.setDeficitPrice(deficitPrice);
|
|
|
waybillOrder.setStatus(CarWaybillEnum.COMPLETION_UNLOADING.getCode());
|
|
|
waybillOrderDao.updateById(waybillOrder);
|
|
|
|
|
|
@@ -1206,9 +1370,14 @@ public class KwtWaybillOrderService {
|
|
|
logisticsOrderCirculateDao.updateByPrimaryKey(circulate);
|
|
|
}
|
|
|
|
|
|
+ /**5跟新司机/车辆数据**/
|
|
|
+ //更新司机信息
|
|
|
+ editDriver(waybillOrder.getDriverId());
|
|
|
+ //更新车辆信息
|
|
|
+ editTruck(waybillOrder.getTruckId());
|
|
|
+
|
|
|
/**5更新承运订单entrustAmount**/
|
|
|
//更新卸货量/卸货时间/亏吨/亏吨扣款
|
|
|
- KwtLogisticsOrder logisticsOrder = logisticsOrderDao.selectById(waybillOrder.getLOrderId());
|
|
|
//承运订单卸货量=承运订单原卸货量+当前车辆运单卸货量
|
|
|
BigDecimal unloadAmount = logisticsOrder.getUnloadAmount() == null ? new BigDecimal(Global.AMOUNT) : logisticsOrder.getUnloadAmount();
|
|
|
logisticsOrder.setUnloadAmount(unloadAmount.add(waybillOrder.getUnloadAmount()));
|
|
|
@@ -1216,7 +1385,8 @@ public class KwtWaybillOrderService {
|
|
|
//承运订单亏吨量=承运订单装货量-承运订单卸货量
|
|
|
logisticsOrder.setDeficitAmount(logisticsOrder.getLoadAmount().subtract(logisticsOrder.getUnloadAmount()));
|
|
|
//承运订单亏吨扣款
|
|
|
- BigDecimal deficitPrice = deficitPrice(logisticsOrder.getLoadAmount(), logisticsOrder.getDeficitAmount(), logisticsOrder.getLoss(), logisticsOrder.getGoodsPrice());
|
|
|
+ deficitPrice = deficitPrice(logisticsOrder.getLoadAmount(), logisticsOrder.getDeficitAmount(),
|
|
|
+ logisticsOrder.getLoss(), logisticsOrder.getGoodsPrice());
|
|
|
logisticsOrder.setDeficitPrice(deficitPrice);
|
|
|
logisticsOrderDao.updateById(logisticsOrder);
|
|
|
|
|
|
@@ -1228,6 +1398,8 @@ public class KwtWaybillOrderService {
|
|
|
SckwWaybillOrder wOrder = new SckwWaybillOrder();
|
|
|
wOrder.set_id(waybillOrder.getId());
|
|
|
wOrder.setUnloadAmount(waybillOrder.getUnloadAmount());
|
|
|
+ wOrder.setDeficitAmount(waybillOrder.getDeficitAmount());
|
|
|
+ wOrder.setDeficitPrice(waybillOrder.getDeficitPrice());
|
|
|
wOrder.setUnloadUrls(params.getUrls());
|
|
|
wOrder.setUnloadTime(waybillOrder.getUpdateTime());
|
|
|
editSckwWaybillOrder(wOrder, waybillOrder, 2);
|
|
|
@@ -1450,16 +1622,26 @@ public class KwtWaybillOrderService {
|
|
|
}
|
|
|
|
|
|
/**2更新车辆运单信息**/
|
|
|
+ KwtLogisticsOrder logisticsOrder = logisticsOrderDao.selectById(waybillOrder.getLOrderId());
|
|
|
waybillOrder.setLoadAmount(params.getType() == 1 ? params.getAmount() : waybillOrder.getLoadAmount());
|
|
|
waybillOrder.setUnloadAmount(params.getType() == 2 ? params.getAmount() : waybillOrder.getUnloadAmount());
|
|
|
waybillOrder.setDeficitAmount(waybillOrder.getLoadAmount().subtract(waybillOrder.getUnloadAmount()));
|
|
|
+ BigDecimal deficitPrice = deficitPrice(waybillOrder.getLoadAmount(), waybillOrder.getDeficitAmount(),
|
|
|
+ logisticsOrder.getLoss(), logisticsOrder.getGoodsPrice());
|
|
|
+ waybillOrder.setDeficitPrice(deficitPrice);
|
|
|
waybillOrderDao.updateById(waybillOrder);
|
|
|
|
|
|
/**3更新榜单信息**/
|
|
|
BeanUtils.copyProperties(params, ticket);
|
|
|
waybillOrderTicketDao.updateById(ticket);
|
|
|
|
|
|
- /**4更新承运订单信息**/
|
|
|
+ /**4跟新司机/车辆数据**/
|
|
|
+ //更新司机信息
|
|
|
+ editDriver(waybillOrder.getDriverId());
|
|
|
+ //更新车辆信息
|
|
|
+ editTruck(waybillOrder.getTruckId());
|
|
|
+
|
|
|
+ /**5更新承运订单信息**/
|
|
|
Map queryParams = new HashMap();
|
|
|
queryParams.put("lOrderId", waybillOrder.getLOrderId());
|
|
|
queryParams.put("loadCountStatus", params.getType() == 1 ? 1 : null);
|
|
|
@@ -1467,13 +1649,12 @@ public class KwtWaybillOrderService {
|
|
|
WaybillCountVo waybillCount = waybillOrderDao.findWaybillOrderCount(queryParams);
|
|
|
|
|
|
//更新卸货量/卸货时间/亏吨/亏吨扣款
|
|
|
- KwtLogisticsOrder logisticsOrder = logisticsOrderDao.selectById(waybillOrder.getLOrderId());
|
|
|
logisticsOrder.setLoadAmount(waybillCount.getLoadAmount());
|
|
|
logisticsOrder.setLoadTime(waybillCount.getLoadTime());
|
|
|
logisticsOrder.setUnloadAmount(waybillCount.getUnloadAmount());
|
|
|
logisticsOrder.setUnloadTime(waybillCount.getUnloadTime());
|
|
|
logisticsOrder.setDeficitAmount(waybillCount.getDeficitAmount());
|
|
|
- BigDecimal deficitPrice = deficitPrice(waybillCount.getLoadAmount(), waybillCount.getDeficitAmount(),
|
|
|
+ deficitPrice = deficitPrice(waybillCount.getLoadAmount(), waybillCount.getDeficitAmount(),
|
|
|
logisticsOrder.getLoss(), logisticsOrder.getGoodsPrice());
|
|
|
logisticsOrder.setDeficitPrice(deficitPrice);
|
|
|
logisticsOrderDao.updateById(logisticsOrder);
|
|
|
@@ -1485,8 +1666,7 @@ public class KwtWaybillOrderService {
|
|
|
checkLogisticsByStatusV1(waybillOrder.getLOrderId());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- /**5Mongodb数据更新**/
|
|
|
+ /**6Mongodb数据更新**/
|
|
|
//1车辆运单
|
|
|
SckwWaybillOrder wOrder = new SckwWaybillOrder();
|
|
|
wOrder.set_id(waybillOrder.getId());
|
|
|
@@ -1497,6 +1677,7 @@ public class KwtWaybillOrderService {
|
|
|
wOrder.setUnloadTime(params.getType() == 2 ? params.getTime() : null);
|
|
|
wOrder.setLoadUrls(params.getType() == 2 ? params.getUrls() : null);
|
|
|
wOrder.setDeficitAmount(waybillOrder.getDeficitAmount());
|
|
|
+ wOrder.setDeficitPrice(waybillOrder.getDeficitPrice());
|
|
|
editSckwWaybillOrder(wOrder, waybillOrder, 2);
|
|
|
|
|
|
//2承运订单
|
|
|
@@ -1555,4 +1736,39 @@ public class KwtWaybillOrderService {
|
|
|
return HttpResult.ok("车辆运单审核完成!");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param driverId 司机档案ID
|
|
|
+ * @desc 更新司机信息
|
|
|
+ * @author zk
|
|
|
+ * @date 2023/8/3
|
|
|
+ **/
|
|
|
+ public void editDriver(Long driverId) {
|
|
|
+ //数据统计
|
|
|
+ WaybillCountVo countVo = waybillOrderDao.findWaybillOrderCount(new HashMap(){{put("driverId", driverId);}});
|
|
|
+ RDriverVo driver = new RDriverVo();
|
|
|
+ driver.setId(driverId);
|
|
|
+ driver.setTotalComplete(countVo.getTotalComplete());
|
|
|
+ driver.setTotalTake(countVo.getTotalTake());
|
|
|
+ driver.setTotalWeight(countVo.getLoadAmount());
|
|
|
+ driver.setBusinessStatus(countVo.getTotalExecute() != null && countVo.getTotalExecute() > 0 ? 1 : 0 );
|
|
|
+ remoteFleetService.updateById(driver);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param driverId 车辆档案ID
|
|
|
+ * @desc 更新车辆信息
|
|
|
+ * @author zk
|
|
|
+ * @date 2023/8/3
|
|
|
+ **/
|
|
|
+ public void editTruck(Long truckId) {
|
|
|
+ //数据统计
|
|
|
+ WaybillCountVo countVo = waybillOrderDao.findWaybillOrderCount(new HashMap(){{put("truckId", truckId);}});
|
|
|
+ RTruckVo truck = new RTruckVo();
|
|
|
+ truck.setId(truckId);
|
|
|
+ truck.setTotalComplete(countVo.getTotalComplete());
|
|
|
+ truck.setTotalTake(countVo.getTotalTake());
|
|
|
+ truck.setTotalWeight(countVo.getLoadAmount());
|
|
|
+ truck.setBusinessStatus(countVo.getTotalExecute() != null && countVo.getTotalExecute() > 0 ? 1 : 0 );
|
|
|
+ remoteFleetService.updateById(truck);
|
|
|
+ }
|
|
|
}
|