|
|
@@ -3,6 +3,7 @@ package com.aoyang.tms.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.aoyang.tms.common.ErrCodeEnum;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
@@ -50,6 +51,19 @@ public class WorkCycleController {
|
|
|
return new Result<>(workCycle);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "更新前行程周期天气", notes = "必传参数:id")
|
|
|
+ @PostMapping("/update_weather")
|
|
|
+ public Result updateWeather(@RequestBody WorkCycle workCycleParam) {
|
|
|
+ log.info("前行程周期,/tms/work_cycle/update,参数:{}", JSON.toJSONString(workCycleParam));
|
|
|
+ if (workCycleParam == null || workCycleParam.getId() == null || StringUtils.isBlank(workCycleParam.getWeather())) {
|
|
|
+ return new Result(ErrCodeEnum.BAD_PARAM.getCode(), ErrCodeEnum.BAD_PARAM.getMessage());
|
|
|
+ }
|
|
|
+ WorkCycle workCycle = workCycleService.getById(workCycleParam.getId());
|
|
|
+ workCycle.setWeather(workCycleParam.getWeather());
|
|
|
+ Boolean flag = workCycleService.updateById(workCycle);
|
|
|
+ return new Result<>(flag);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "获取历史行车列表", notes = "")
|
|
|
@PostMapping("/list")
|
|
|
public Result list(@RequestBody PageParam<WorkCycle> pageParam) {
|