11 changed files with 96 additions and 88 deletions
@ -1,71 +0,0 @@
@@ -1,71 +0,0 @@
|
||||
package com.cloud.kicc.commonbiz.controller; |
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.commonbiz.api.entity.LogisticMap; |
||||
import com.cloud.kicc.commonbiz.service.ILogisticMapService; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
|
||||
/** |
||||
* <p> |
||||
* 地图核心主任务表 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author entfrm开发团队-王翔 |
||||
* @since 2022-07-22 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping(AppConstants.APP_COMMON + "/logisticMap") |
||||
@RequiredArgsConstructor |
||||
public class LogisticMapController { |
||||
|
||||
private final ILogisticMapService iLogisticMapService; |
||||
|
||||
private LambdaQueryWrapper<LogisticMap> getQueryWrapper(LogisticMap logisticMap) { |
||||
return new LambdaQueryWrapper<LogisticMap>() |
||||
.eq(StrUtil.isNotBlank(logisticMap.getCourierUserId()), LogisticMap::getCourierUserId, logisticMap.getCourierUserId()) |
||||
.eq(StrUtil.isNotBlank(logisticMap.getBatchCode()), LogisticMap::getBatchCode, logisticMap.getBatchCode()) |
||||
.like(StrUtil.isNotBlank(logisticMap.getName()), LogisticMap::getName, logisticMap.getName()) |
||||
.between(StrUtil.isAllNotBlank(logisticMap.getBeginTime(), logisticMap.getEndTime()), LogisticMap::getCreateTime, logisticMap.getBeginTime(), logisticMap.getEndTime()); |
||||
} |
||||
|
||||
@GetMapping("/list") |
||||
public R list(Page page, LogisticMap logisticMap) { |
||||
IPage<LogisticMap> iPage = iLogisticMapService.page(page, getQueryWrapper(logisticMap)); |
||||
return R.ok(iPage.getRecords(), iPage.getTotal()); |
||||
} |
||||
|
||||
@GetMapping("/{id:\\w+}") |
||||
public R getById(@PathVariable("id") String id) { |
||||
LogisticMap logisticMap = iLogisticMapService.getById(id); |
||||
return R.ok(logisticMap); |
||||
} |
||||
|
||||
@PostMapping("/save") |
||||
public R save(@RequestBody LogisticMap logisticMap) { |
||||
iLogisticMapService.save(logisticMap); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@PutMapping("/update") |
||||
public R update(@RequestBody LogisticMap logisticMap) { |
||||
iLogisticMapService.updateById(logisticMap); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@DeleteMapping("/remove/{ids:[\\w,]+}") |
||||
public R remove(@PathVariable String[] ids) { |
||||
iLogisticMapService.removeByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,71 @@
@@ -0,0 +1,71 @@
|
||||
package com.cloud.kicc.commonbiz.controller; |
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.cloud.kicc.common.core.api.R; |
||||
import com.cloud.kicc.common.core.constant.AppConstants; |
||||
import com.cloud.kicc.commonbiz.api.entity.MapLogistic; |
||||
import com.cloud.kicc.commonbiz.service.IMapLogisticService; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import java.util.Arrays; |
||||
|
||||
/** |
||||
* <p> |
||||
* 地图核心主任务表 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author entfrm开发团队-王翔 |
||||
* @since 2022-07-22 |
||||
*/ |
||||
@RestController |
||||
@RequestMapping(AppConstants.APP_COMMON + "/mapLogistic") |
||||
@RequiredArgsConstructor |
||||
public class MapLogisticController { |
||||
|
||||
private final IMapLogisticService iMapLogisticService; |
||||
|
||||
private LambdaQueryWrapper<MapLogistic> getQueryWrapper(MapLogistic mapLogistic) { |
||||
return new LambdaQueryWrapper<MapLogistic>() |
||||
.eq(StrUtil.isNotBlank(mapLogistic.getCourierUserId()), MapLogistic::getCourierUserId, mapLogistic.getCourierUserId()) |
||||
.eq(StrUtil.isNotBlank(mapLogistic.getBatchCode()), MapLogistic::getBatchCode, mapLogistic.getBatchCode()) |
||||
.like(StrUtil.isNotBlank(mapLogistic.getName()), MapLogistic::getName, mapLogistic.getName()) |
||||
.between(StrUtil.isAllNotBlank(mapLogistic.getBeginTime(), mapLogistic.getEndTime()), MapLogistic::getCreateTime, mapLogistic.getBeginTime(), mapLogistic.getEndTime()); |
||||
} |
||||
|
||||
@GetMapping("/list") |
||||
public R list(Page page, MapLogistic mapLogistic) { |
||||
IPage<MapLogistic> iPage = iMapLogisticService.page(page, getQueryWrapper(mapLogistic)); |
||||
return R.ok(iPage.getRecords(), iPage.getTotal()); |
||||
} |
||||
|
||||
@GetMapping("/{id:\\w+}") |
||||
public R getById(@PathVariable("id") String id) { |
||||
MapLogistic mapLogistic = iMapLogisticService.getById(id); |
||||
return R.ok(mapLogistic); |
||||
} |
||||
|
||||
@PostMapping("/save") |
||||
public R save(@RequestBody MapLogistic mapLogistic) { |
||||
iMapLogisticService.save(mapLogistic); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@PutMapping("/update") |
||||
public R update(@RequestBody MapLogistic mapLogistic) { |
||||
iMapLogisticService.updateById(mapLogistic); |
||||
return R.ok(); |
||||
} |
||||
|
||||
@DeleteMapping("/remove/{ids:[\\w,]+}") |
||||
public R remove(@PathVariable String[] ids) { |
||||
iMapLogisticService.removeByIds(Arrays.asList(ids)); |
||||
return R.ok(); |
||||
} |
||||
|
||||
} |
||||
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="com.cloud.kicc.commonbiz.mapper.LogisticMapMapper"> |
||||
<mapper namespace="com.cloud.kicc.commonbiz.mapper.MapLogisticMapper"> |
||||
|
||||
</mapper> |
Loading…
Reference in new issue