|
@@ -4,6 +4,8 @@ package com.aoyang.tms.controller;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.aoyang.tms.common.ErrCodeEnum;
|
|
import com.aoyang.tms.common.ErrCodeEnum;
|
|
|
import com.aoyang.tms.entity.TruckDept;
|
|
import com.aoyang.tms.entity.TruckDept;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
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;
|
|
@@ -120,4 +122,17 @@ public class WorkSpotController {
|
|
|
}
|
|
}
|
|
|
return new Result<>(workSpotService.getById(param));
|
|
return new Result<>(workSpotService.getById(param));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "根据id获取作业点详情", notes = "必传参数:spotId")
|
|
|
|
|
+ @PostMapping("/find_by_name")
|
|
|
|
|
+ public Result findByName(@RequestBody WorkSpot param) {
|
|
|
|
|
+ log.info("根据id获取作业点详情,调用/tms/work_spot/findByName,参数:{}", JSON.toJSONString(param));
|
|
|
|
|
+ if (param == null || StringUtils.isBlank(param.getSpotName())) {
|
|
|
|
|
+ return new Result<>(ErrCodeEnum.BAD_PARAM.getCode(), ErrCodeEnum.BAD_PARAM.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ QueryWrapper<WorkSpot> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
+ queryWrapper.like("spot_name", param.getSpotName());
|
|
|
|
|
+ return new Result<>(workSpotService.list(queryWrapper));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|