|
|
|
@ -1,10 +1,18 @@
@@ -1,10 +1,18 @@
|
|
|
|
|
package com.cloud.kicc.commonbiz.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
|
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 org.springframework.stereotype.Controller; |
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* <p> |
|
|
|
@ -15,10 +23,49 @@ import org.springframework.web.bind.annotation.RestController;
@@ -15,10 +23,49 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
* @since 2022-07-22 |
|
|
|
|
*/ |
|
|
|
|
@RestController |
|
|
|
|
@RequestMapping("/map") |
|
|
|
|
@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(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|