|
@@ -10,10 +10,12 @@ import com.aoyang.tms.common.ErrCodeEnum;
|
|
|
import com.aoyang.tms.common.WorkOrderEnum;
|
|
import com.aoyang.tms.common.WorkOrderEnum;
|
|
|
import com.aoyang.tms.controller.param.WorkManagePageParam;
|
|
import com.aoyang.tms.controller.param.WorkManagePageParam;
|
|
|
import com.aoyang.tms.controller.vo.AddWorkOrderVO;
|
|
import com.aoyang.tms.controller.vo.AddWorkOrderVO;
|
|
|
|
|
+import com.aoyang.tms.controller.vo.TruckHistoryTripVO;
|
|
|
import com.aoyang.tms.controller.vo.TruckOrderManageVO;
|
|
import com.aoyang.tms.controller.vo.TruckOrderManageVO;
|
|
|
import com.aoyang.tms.controller.vo.TruckOrderStatisticsVO;
|
|
import com.aoyang.tms.controller.vo.TruckOrderStatisticsVO;
|
|
|
import com.aoyang.tms.entity.*;
|
|
import com.aoyang.tms.entity.*;
|
|
|
import com.aoyang.tms.service.*;
|
|
import com.aoyang.tms.service.*;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -59,6 +61,10 @@ public class WorkOrderManageController {
|
|
|
private TruckDriverService truckDriverService;
|
|
private TruckDriverService truckDriverService;
|
|
|
@Resource
|
|
@Resource
|
|
|
private WorkSpotService workSpotService;
|
|
private WorkSpotService workSpotService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private WorkCycleService workCycleService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private WorkLogService workLogService;
|
|
|
|
|
|
|
|
@ApiOperation(value = "获取运力调度列表",notes="")
|
|
@ApiOperation(value = "获取运力调度列表",notes="")
|
|
|
@PostMapping("/list")
|
|
@PostMapping("/list")
|
|
@@ -78,6 +84,46 @@ public class WorkOrderManageController {
|
|
|
return new Result<>(workOrderService.getTruckOrderStatistics(orgId));
|
|
return new Result<>(workOrderService.getTruckOrderStatistics(orgId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "车辆历史行程",notes="")
|
|
|
|
|
+ @PostMapping("/history_trip")
|
|
|
|
|
+ public Result<List<TruckHistoryTripVO>> historyTrip(@RequestBody Truck truck) {
|
|
|
|
|
+ if (truck == null || truck.getTruckId() == null) {
|
|
|
|
|
+ return new Result<>(ErrCodeEnum.BAD_PARAM.getCode(), ErrCodeEnum.BAD_PARAM.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ log.info("获取车辆历史行程,调用/tms/work_order_manage/history_trip truck:{} ", truck.getTruckId());
|
|
|
|
|
+ List<WorkCycle> workCycles = workCycleService.list(new QueryWrapper<WorkCycle>().eq("truck_id", truck.getTruckId()));
|
|
|
|
|
+ List<TruckHistoryTripVO> resultList = new ArrayList<>();
|
|
|
|
|
+ for (WorkCycle workCycle : workCycles) {
|
|
|
|
|
+ TruckHistoryTripVO vo = new TruckHistoryTripVO();
|
|
|
|
|
+ vo.setCycleId(workCycle.getId());
|
|
|
|
|
+ QueryWrapper<WorkOrder> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
+ queryWrapper.eq("cycle_id", workCycle.getId());
|
|
|
|
|
+ queryWrapper.eq("type", 1);
|
|
|
|
|
+ vo.setLoadCount(workOrderService.count(queryWrapper));
|
|
|
|
|
+ queryWrapper.eq("type", 2);
|
|
|
|
|
+ vo.setUnloadCount(workOrderService.count(queryWrapper));
|
|
|
|
|
+ vo.setStartTime(workCycle.getStartTime());
|
|
|
|
|
+ vo.setEndTime(workCycle.getEndTime());
|
|
|
|
|
+ resultList.add(vo);
|
|
|
|
|
+ }
|
|
|
|
|
+ return new Result<>(resultList);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "车辆行车详情",notes="")
|
|
|
|
|
+ @PostMapping("/history_trip_detail")
|
|
|
|
|
+ public Result<List<WorkLog>> historyTripDetail(@RequestBody IdParam idParam) {
|
|
|
|
|
+ log.info("获取车辆历史行程,调用/tms/work_order_manage/history_trip idParam:{} ", JSON.toJSONString(idParam));
|
|
|
|
|
+ if (idParam == null || idParam.getId() == null) {
|
|
|
|
|
+ return new Result<>(ErrCodeEnum.BAD_PARAM.getCode(), ErrCodeEnum.BAD_PARAM.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ WorkCycle workCycle = workCycleService.getById(idParam.getId());
|
|
|
|
|
+ if (workCycle == null) {
|
|
|
|
|
+ return new Result<>(ErrCodeEnum.BAD_PARAM.getCode(), "行车周期不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ List<WorkLog> workLogs = workLogService.list(new QueryWrapper<WorkLog>().eq("cycle_id", idParam.getId()));
|
|
|
|
|
+ return new Result<>(workLogs);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@ApiOperation(value = "新增装车派单", notes = "调度员派单操作")
|
|
@ApiOperation(value = "新增装车派单", notes = "调度员派单操作")
|
|
|
@PostMapping("/add_load_order")
|
|
@PostMapping("/add_load_order")
|
|
|
public Result add(@RequestHeader(value = "orgId") Long orgId,
|
|
public Result add(@RequestHeader(value = "orgId") Long orgId,
|