| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | |
| | | |
| | | /** |
| | | * 新增经纬度点 |
| | | * @param manageCoordinateDetail |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("insert") |
| | | public ResultMessage insert(@RequestBody ManageCoordinateDetail manageCoordinateDetail){ |
| | | if (ObjectUtils.isEmpty(manageCoordinateDetail)){ |
| | | public ResultMessage insert(@RequestBody Map<String,Object> params){ |
| | | if (ObjectUtils.isEmpty(params)){ |
| | | return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); |
| | | } |
| | | Integer integer = manageCoordinateDetailService.insertCoordinate(manageCoordinateDetail); |
| | | if (integer==null){ |
| | | Integer integer = manageCoordinateDetailService.insertCoordinate(params); |
| | | if (integer==1){ |
| | | return ResultMessage.ok("经纬度已存在"); |
| | | } |
| | | if (integer==2){ |
| | | return ResultMessage.ok("经纬度不存在"); |
| | | } |
| | | return ResultMessage.ok(); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "time2", value = "时间,2021-08-18", required = true, paramType = "query", dataType = "String") |
| | | }) |
| | | public ResultMessage getInserts(@RequestBody Map<String,Object> params){ |
| | | if (!params.containsKey("coordinateId") || !params.containsKey("time1")|| !params.containsKey("time2")) { |
| | | if (!params.containsKey("coordinateId")) { |
| | | return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); |
| | | } |
| | | |
| | | |
| | | return null; |
| | | Integer integer = manageCoordinateDetailService.batchAll(params); |
| | | if (integer!=200){ |
| | | return ResultMessage.ok("操作失败"); |
| | | } |
| | | return ResultMessage.ok(integer); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除经纬度点 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("delete") |
| | | public ResultMessage delete(Integer id){ |
| | | if (id==null){ |
| | | return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); |
| | | } |
| | | manageCoordinateDetailService.deleteCoordinate(id); |
| | | return ResultMessage.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询坐标点 |
| | | * @return |
| | | */ |
| | | @GetMapping("select") |
| | | @PostMapping("select") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String"), |
| | | @ApiImplicitParam(name = "coordinateId", value = "路段id", required = true, paramType = "query", dataType = "String"), |
| | |
| | | @ApiImplicitParam(name = "time2", value = "时间,2021-08-18", required = true, paramType = "query", dataType = "String") |
| | | }) |
| | | public ResultMessage selectAll(@RequestBody Map<String,Object> params){ |
| | | if (!params.containsKey("coordinateId") || !params.containsKey("time1")|| !params.containsKey("time2")) { |
| | | if (!params.containsKey("coordinateId") || !params.containsKey("time1")|| !params.containsKey("time2")|| !params.containsKey("mac")) { |
| | | return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); |
| | | } |
| | | Map<String, Object> map = manageCoordinateDetailService.selectCoordinate(params); |
| | | return null; |
| | | Map<String,Object> rsMap = manageCoordinateDetailService.selectCoordinate(params); |
| | | return ResultMessage.ok(rsMap); |
| | | } |
| | | |
| | | @PostMapping("queryAll") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "token", value = "token", required = true, paramType = "header", dataType = "String"), |
| | | @ApiImplicitParam(name = "mac", value = "mac号", required = true, paramType = "query", dataType = "String"), |
| | | @ApiImplicitParam(name = "time1", value = "开始时间,2021-08-18", required = true, paramType = "query", dataType = "String"), |
| | | @ApiImplicitParam(name = "time2", value = "结束时间,2021-08-18", required = true, paramType = "query", dataType = "String") |
| | | }) |
| | | public ResultMessage queryAll(@RequestBody Map<String,Object> params){ |
| | | manageCoordinateDetailService.queryAll(params); |
| | | return ResultMessage.ok(); |
| | | } |
| | | } |