|
|
@@ -3,7 +3,10 @@ package com.aoyang.tms.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.aoyang.tms.common.ErrCodeEnum;
|
|
|
+import com.aoyang.tms.controller.param.WorkCycleVO;
|
|
|
+import com.aoyang.tms.util.DateUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
@@ -11,7 +14,6 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.*;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
-import java.util.*;
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import com.aoyang.tms.service.WorkCycleService;
|
|
|
@@ -22,6 +24,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.aoyang.common.param.PageParam;
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
@@ -47,7 +51,15 @@ public class WorkCycleController {
|
|
|
if (workCycleParam == null || workCycleParam.getTruckId() == null) {
|
|
|
return new Result(ErrCodeEnum.BAD_PARAM.getCode(), ErrCodeEnum.BAD_PARAM.getMessage());
|
|
|
}
|
|
|
+ WorkCycleVO workCycleVo = new WorkCycleVO();
|
|
|
WorkCycle workCycle = workCycleService.findCurrentWorkCycle(workCycleParam.getTruckId());
|
|
|
+ BeanUtils.copyProperties(workCycle, workCycleVo);
|
|
|
+ if (workCycle.getStatus() == 1) {
|
|
|
+ workCycleVo.setTime(DateUtils.betweenTime(workCycle.getStartTime(), LocalDateTime.now()));
|
|
|
+ }
|
|
|
+ if (workCycle.getStatus() == 2) {
|
|
|
+ workCycleVo.setTime(DateUtils.betweenTime(workCycle.getStartTime(), workCycle.getEndTime()));
|
|
|
+ }
|
|
|
return new Result<>(workCycle);
|
|
|
}
|
|
|
|