|
@@ -89,6 +89,7 @@ public class CommonServiceImpl implements CommonService {
|
|
|
@Override
|
|
@Override
|
|
|
public WorkerInfo findTruckInfo(Long truckId) {
|
|
public WorkerInfo findTruckInfo(Long truckId) {
|
|
|
WorkerInfo workerInfo = new WorkerInfo();
|
|
WorkerInfo workerInfo = new WorkerInfo();
|
|
|
|
|
+ //车辆信息
|
|
|
workerInfo.setTruckId(truckId);
|
|
workerInfo.setTruckId(truckId);
|
|
|
log.info("findTruckInfo findTruck 参数:{}", JSON.toJSONString(truckId));
|
|
log.info("findTruckInfo findTruck 参数:{}", JSON.toJSONString(truckId));
|
|
|
Truck truckParam = new Truck();
|
|
Truck truckParam = new Truck();
|
|
@@ -102,31 +103,13 @@ public class CommonServiceImpl implements CommonService {
|
|
|
workerInfo.setDeptId(truck.getDeptId());
|
|
workerInfo.setDeptId(truck.getDeptId());
|
|
|
workerInfo.setDeptName(truck.getDeptName());
|
|
workerInfo.setDeptName(truck.getDeptName());
|
|
|
workerInfo.setIsZhongche("空车");
|
|
workerInfo.setIsZhongche("空车");
|
|
|
- //查询最后一笔已经执行或执行中的订单
|
|
|
|
|
- WorkOrder workOrder = workOrderService.findLastWorkOrder(truckId);
|
|
|
|
|
- if (workOrder != null) {
|
|
|
|
|
- workerInfo.setOrderId(workOrder.getId());
|
|
|
|
|
- WorkCycle workCycle = workCycleService.getById(workOrder.getCycleId());
|
|
|
|
|
- if (workCycle != null && workCycle.getEndTime() == null) {
|
|
|
|
|
- workerInfo.setCycleId(workCycle.getId());
|
|
|
|
|
- //装车订单判断
|
|
|
|
|
- if (workOrder.getType() == 1) {
|
|
|
|
|
- if (workOrder.getOrderStatus().equals(WorkOrderEnum.ZHUANGCHE_RESULT_SUBMIT.orderStatus()) || workOrder.getOrderStatus().equals(WorkOrderEnum.COMPLETED.orderStatus()) || workOrder.getOrderStatus().equals(WorkOrderEnum.CLOSED.orderStatus())) {
|
|
|
|
|
- workerInfo.setIsZhongche("重车");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //卸车订单判断
|
|
|
|
|
- if (workOrder.getType() == 2) {
|
|
|
|
|
- if (workOrder.getOrderStatus().equals(WorkOrderEnum.COMPLETED.orderStatus())) {
|
|
|
|
|
- if (Double.valueOf(workOrder.getJingWeight()) > 0) {
|
|
|
|
|
- workerInfo.setIsZhongche("重车");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ boolean zhongFlag = checkTruckZhong(truckId);
|
|
|
|
|
+ if (zhongFlag) {
|
|
|
|
|
+ workerInfo.setIsZhongche("重车");
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+ //司机信息
|
|
|
log.info("findTruckInfo findTruckDrivers 参数:{}", JSON.toJSONString(truckId));
|
|
log.info("findTruckInfo findTruckDrivers 参数:{}", JSON.toJSONString(truckId));
|
|
|
List<TruckDriver> truckDrivers = truckDriverService.findTruckDrivers(truckId);
|
|
List<TruckDriver> truckDrivers = truckDriverService.findTruckDrivers(truckId);
|
|
|
log.info("findTruckInfo findTruckDrivers 结果:{}", JSON.toJSONString(truckDrivers));
|
|
log.info("findTruckInfo findTruckDrivers 结果:{}", JSON.toJSONString(truckDrivers));
|
|
@@ -148,6 +131,7 @@ public class CommonServiceImpl implements CommonService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //押运员信息
|
|
|
TruckEscort truckEscortParam = new TruckEscort();
|
|
TruckEscort truckEscortParam = new TruckEscort();
|
|
|
truckEscortParam.setTruckId(truckId);
|
|
truckEscortParam.setTruckId(truckId);
|
|
|
log.info("findTruckInfo findTruckEscort 参数:{}", JSON.toJSONString(truckEscortParam));
|
|
log.info("findTruckInfo findTruckEscort 参数:{}", JSON.toJSONString(truckEscortParam));
|
|
@@ -163,6 +147,19 @@ public class CommonServiceImpl implements CommonService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //查询当前行车周期
|
|
|
|
|
+ WorkCycle workCycle = workCycleService.findCurrentWorkCycle(truckId);
|
|
|
|
|
+ //完成订单列表
|
|
|
|
|
+ List<WorkOrder> list =
|
|
|
|
|
+ workOrderService.findCycleOrderList(workCycle.getId(), 1, WorkOrderEnum.COMPLETED.orderStatus());
|
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
|
|
+ workerInfo.setZhuangcheNumber(list.size());
|
|
|
|
|
+ }
|
|
|
|
|
+ list = workOrderService.findCycleOrderList(workCycle.getId(), 2, WorkOrderEnum.COMPLETED.orderStatus());
|
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
|
|
+ workerInfo.setXiecheNumber(list.size());
|
|
|
|
|
+ }
|
|
|
|
|
+ //位置信息
|
|
|
LocationVO locationVO = getLocationByDate(truckId, LocalDateTime.now());
|
|
LocationVO locationVO = getLocationByDate(truckId, LocalDateTime.now());
|
|
|
if (locationVO != null) {
|
|
if (locationVO != null) {
|
|
|
workerInfo.setLatitude(locationVO.getLatitude());
|
|
workerInfo.setLatitude(locationVO.getLatitude());
|
|
@@ -321,7 +318,7 @@ public class CommonServiceImpl implements CommonService {
|
|
|
String url = BAIDUMAP_URL + "&ak=" + BAIDUMAP_AK + "&location=" + lat + "," + lng;
|
|
String url = BAIDUMAP_URL + "&ak=" + BAIDUMAP_AK + "&location=" + lat + "," + lng;
|
|
|
log.info("请求url:" + url);
|
|
log.info("请求url:" + url);
|
|
|
String res = doGet(url);
|
|
String res = doGet(url);
|
|
|
- String Addresslocation= JSON.parseObject(res).getJSONObject("result").getString("formatted_address");
|
|
|
|
|
|
|
+ String Addresslocation = JSON.parseObject(res).getJSONObject("result").getString("formatted_address");
|
|
|
System.out.println(Addresslocation);
|
|
System.out.println(Addresslocation);
|
|
|
return Addresslocation;
|
|
return Addresslocation;
|
|
|
}
|
|
}
|