|
|
@ -9,6 +9,8 @@ import com.cloud.kicc.common.core.api.R; |
|
|
|
import com.cloud.kicc.common.core.constant.AppConstants; |
|
|
|
import com.cloud.kicc.common.core.constant.AppConstants; |
|
|
|
import com.cloud.kicc.commonbiz.api.entity.MapTaskPreset; |
|
|
|
import com.cloud.kicc.commonbiz.api.entity.MapTaskPreset; |
|
|
|
import com.cloud.kicc.commonbiz.service.IMapTaskPresetService; |
|
|
|
import com.cloud.kicc.commonbiz.service.IMapTaskPresetService; |
|
|
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.stereotype.Controller; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
@ -26,41 +28,48 @@ import java.util.Arrays; |
|
|
|
@RestController |
|
|
|
@RestController |
|
|
|
@RequestMapping(AppConstants.APP_COMMON + "/mapTaskPreset") |
|
|
|
@RequestMapping(AppConstants.APP_COMMON + "/mapTaskPreset") |
|
|
|
@RequiredArgsConstructor |
|
|
|
@RequiredArgsConstructor |
|
|
|
|
|
|
|
@Api(tags = "地图交接任务预设管理") |
|
|
|
public class MapTaskPresetController { |
|
|
|
public class MapTaskPresetController { |
|
|
|
|
|
|
|
|
|
|
|
private final IMapTaskPresetService iMapTaskPresetService; |
|
|
|
private final IMapTaskPresetService iMapTaskPresetService; |
|
|
|
|
|
|
|
|
|
|
|
private LambdaQueryWrapper<MapTaskPreset> getQueryWrapper(MapTaskPreset mapTaskPreset) { |
|
|
|
private LambdaQueryWrapper<MapTaskPreset> getQueryWrapper(MapTaskPreset mapTaskPreset) { |
|
|
|
return new LambdaQueryWrapper<MapTaskPreset>() |
|
|
|
return new LambdaQueryWrapper<MapTaskPreset>() |
|
|
|
|
|
|
|
.eq(StrUtil.isNotBlank(mapTaskPreset.getCourierUserId()), MapTaskPreset::getCourierUserId, mapTaskPreset.getCourierUserId()) |
|
|
|
.like(StrUtil.isNotBlank(mapTaskPreset.getName()), MapTaskPreset::getName, mapTaskPreset.getName()) |
|
|
|
.like(StrUtil.isNotBlank(mapTaskPreset.getName()), MapTaskPreset::getName, mapTaskPreset.getName()) |
|
|
|
.eq(StrUtil.isNotBlank(mapTaskPreset.getMapLogisticId()), MapTaskPreset::getMapLogisticId, mapTaskPreset.getMapLogisticId()); |
|
|
|
.eq(StrUtil.isNotBlank(mapTaskPreset.getMapLogisticId()), MapTaskPreset::getMapLogisticId, mapTaskPreset.getMapLogisticId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
@GetMapping("/list") |
|
|
|
|
|
|
|
@ApiOperation(value = "分页查询", notes = "分页查询") |
|
|
|
public R list(Page page, MapTaskPreset mapTaskPreset) { |
|
|
|
public R list(Page page, MapTaskPreset mapTaskPreset) { |
|
|
|
IPage<MapTaskPreset> result = iMapTaskPresetService.page(page, getQueryWrapper(mapTaskPreset)); |
|
|
|
IPage<MapTaskPreset> result = iMapTaskPresetService.page(page, getQueryWrapper(mapTaskPreset)); |
|
|
|
return R.ok(result.getRecords(), result.getTotal()); |
|
|
|
return R.ok(result.getRecords(), result.getTotal()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/{id:\\w+}") |
|
|
|
@GetMapping("/{id:\\w+}") |
|
|
|
|
|
|
|
@ApiOperation(value = "根据id获取", notes = "根据id获取") |
|
|
|
public R getById(@PathVariable("id") String id) { |
|
|
|
public R getById(@PathVariable("id") String id) { |
|
|
|
MapTaskPreset mapTaskPreset = iMapTaskPresetService.getById(id); |
|
|
|
MapTaskPreset mapTaskPreset = iMapTaskPresetService.getById(id); |
|
|
|
return R.ok(mapTaskPreset); |
|
|
|
return R.ok(mapTaskPreset); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/save") |
|
|
|
@PostMapping("/save") |
|
|
|
|
|
|
|
@ApiOperation(value = "保存", notes = "保存") |
|
|
|
public R save(@RequestBody MapTaskPreset mapTaskPreset) { |
|
|
|
public R save(@RequestBody MapTaskPreset mapTaskPreset) { |
|
|
|
iMapTaskPresetService.save(mapTaskPreset); |
|
|
|
iMapTaskPresetService.save(mapTaskPreset); |
|
|
|
return R.ok(); |
|
|
|
return R.ok(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PutMapping("/update") |
|
|
|
@PutMapping("/update") |
|
|
|
|
|
|
|
@ApiOperation(value = "修改", notes = "修改") |
|
|
|
public R update(@RequestBody MapTaskPreset mapTaskPreset) { |
|
|
|
public R update(@RequestBody MapTaskPreset mapTaskPreset) { |
|
|
|
iMapTaskPresetService.updateById(mapTaskPreset); |
|
|
|
iMapTaskPresetService.updateById(mapTaskPreset); |
|
|
|
return R.ok(); |
|
|
|
return R.ok(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@DeleteMapping("/remove/{ids:[\\w,]+}") |
|
|
|
@DeleteMapping("/remove/{ids:[\\w,]+}") |
|
|
|
|
|
|
|
@ApiOperation(value = "删除", notes = "删除") |
|
|
|
public R remove(@PathVariable String[] ids) { |
|
|
|
public R remove(@PathVariable String[] ids) { |
|
|
|
iMapTaskPresetService.removeByIds(Arrays.asList(ids)); |
|
|
|
iMapTaskPresetService.removeByIds(Arrays.asList(ids)); |
|
|
|
return R.ok(); |
|
|
|
return R.ok(); |
|
|
|