|
@@ -1,16 +1,20 @@
|
|
|
package com.aoyang.tms.controller;
|
|
package com.aoyang.tms.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
|
|
+import com.aoyang.tms.common.ErrCodeEnum;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
-import com.aoyang.tms.service.WorkCycleService;
|
|
|
|
|
-import com.aoyang.tms.entity.WorkCycle;
|
|
|
|
|
|
|
+
|
|
|
|
|
+import com.aoyang.tms.service.WorkCycleService;
|
|
|
|
|
+import com.aoyang.tms.entity.WorkCycle;
|
|
|
import com.aoyang.common.result.Result;
|
|
import com.aoyang.common.result.Result;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -20,8 +24,8 @@ import com.aoyang.common.param.PageParam;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* <p>
|
|
* <p>
|
|
|
- * 行程周期表,行程开始到行程结束,包含一装多卸周期 控制器
|
|
|
|
|
- * </p>
|
|
|
|
|
|
|
+ * 行程周期表,行程开始到行程结束,包含一装多卸周期 控制器
|
|
|
|
|
+ * </p>
|
|
|
*
|
|
*
|
|
|
* @author guoyong
|
|
* @author guoyong
|
|
|
* @since 2022-04-21
|
|
* @since 2022-04-21
|
|
@@ -35,7 +39,18 @@ public class WorkCycleController {
|
|
|
@Resource
|
|
@Resource
|
|
|
private WorkCycleService workCycleService;
|
|
private WorkCycleService workCycleService;
|
|
|
|
|
|
|
|
- @ApiOperation(value = "获取历史行车列表",notes="")
|
|
|
|
|
|
|
+ @ApiOperation(value = "查询当前行程周期", notes = "必传参数:truckId")
|
|
|
|
|
+ @PostMapping("/find")
|
|
|
|
|
+ public Result find(@RequestBody WorkCycle workCycleParam) {
|
|
|
|
|
+ log.info("查询当前行程周期,/tms/work_cycle/find,参数:{}", JSON.toJSONString(workCycleParam));
|
|
|
|
|
+ if (workCycleParam == null || workCycleParam.getTruckId() == null) {
|
|
|
|
|
+ return new Result(ErrCodeEnum.BAD_PARAM.getCode(), ErrCodeEnum.BAD_PARAM.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ WorkCycle workCycle = workCycleService.findCurrentWorkCycle(workCycleParam.getTruckId());
|
|
|
|
|
+ return new Result<>(workCycle);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "获取历史行车列表", notes = "")
|
|
|
@PostMapping("/list")
|
|
@PostMapping("/list")
|
|
|
public Result list(@RequestBody PageParam<WorkCycle> pageParam) {
|
|
public Result list(@RequestBody PageParam<WorkCycle> pageParam) {
|
|
|
Page<WorkCycle> page = new Page<>(pageParam.getPage(), pageParam.getSize());
|
|
Page<WorkCycle> page = new Page<>(pageParam.getPage(), pageParam.getSize());
|