新增自提门店管理
parent
f8db53896f
commit
894b19b8ec
@ -0,0 +1,98 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.controller.admin.delivery;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.*;
|
||||||
|
import cn.iocoder.yudao.module.trade.convert.delivery.DeliveryPickUpStoreConvert;
|
||||||
|
import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryPickUpStoreDO;
|
||||||
|
import cn.iocoder.yudao.module.trade.service.delivery.DeliveryPickUpStoreService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 自提门店")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/trade/delivery/pick-up-store")
|
||||||
|
@Validated
|
||||||
|
public class DeliveryPickUpStoreController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DeliveryPickUpStoreService deliveryPickUpStoreService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建自提门店")
|
||||||
|
@PreAuthorize("@ss.hasPermission('trade:delivery:pick-up-store:create')")
|
||||||
|
public CommonResult<Long> createDeliveryPickUpStore(@Valid @RequestBody DeliveryPickUpStoreCreateReqVO createReqVO) {
|
||||||
|
return success(deliveryPickUpStoreService.createDeliveryPickUpStore(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新自提门店")
|
||||||
|
@PreAuthorize("@ss.hasPermission('trade:delivery:pick-up-store:update')")
|
||||||
|
public CommonResult<Boolean> updateDeliveryPickUpStore(@Valid @RequestBody DeliveryPickUpStoreUpdateReqVO updateReqVO) {
|
||||||
|
deliveryPickUpStoreService.updateDeliveryPickUpStore(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除自提门店")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('trade:delivery:pick-up-store:delete')")
|
||||||
|
public CommonResult<Boolean> deleteDeliveryPickUpStore(@RequestParam("id") Long id) {
|
||||||
|
deliveryPickUpStoreService.deleteDeliveryPickUpStore(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得自提门店")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('trade:delivery:pick-up-store:query')")
|
||||||
|
public CommonResult<DeliveryPickUpStoreRespVO> getDeliveryPickUpStore(@RequestParam("id") Long id) {
|
||||||
|
DeliveryPickUpStoreDO deliveryPickUpStore = deliveryPickUpStoreService.getDeliveryPickUpStore(id);
|
||||||
|
return success(DeliveryPickUpStoreConvert.INSTANCE.convert(deliveryPickUpStore));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@Operation(summary = "获得自提门店列表")
|
||||||
|
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
||||||
|
@PreAuthorize("@ss.hasPermission('trade:delivery:pick-up-store:query')")
|
||||||
|
public CommonResult<List<DeliveryPickUpStoreRespVO>> getDeliveryPickUpStoreList(@RequestParam("ids") Collection<Long> ids) {
|
||||||
|
List<DeliveryPickUpStoreDO> list = deliveryPickUpStoreService.getDeliveryPickUpStoreList(ids);
|
||||||
|
return success(DeliveryPickUpStoreConvert.INSTANCE.convertList(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得自提门店分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('trade:delivery:pick-up-store:query')")
|
||||||
|
public CommonResult<PageResult<DeliveryPickUpStoreRespVO>> getDeliveryPickUpStorePage(@Valid DeliveryPickUpStorePageReqVO pageVO) {
|
||||||
|
PageResult<DeliveryPickUpStoreDO> pageResult = deliveryPickUpStoreService.getDeliveryPickUpStorePage(pageVO);
|
||||||
|
return success(DeliveryPickUpStoreConvert.INSTANCE.convertPage(pageResult));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出自提门店 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('trade:delivery:pick-up-store:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportDeliveryPickUpStoreExcel(@Valid DeliveryPickUpStoreExportReqVO exportReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
List<DeliveryPickUpStoreDO> list = deliveryPickUpStoreService.getDeliveryPickUpStoreList(exportReqVO);
|
||||||
|
// 导出 Excel
|
||||||
|
List<DeliveryPickUpStoreExcelVO> datas = DeliveryPickUpStoreConvert.INSTANCE.convertList02(list);
|
||||||
|
ExcelUtils.write(response, "自提门店.xls", "数据", DeliveryPickUpStoreExcelVO.class, datas);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 自提门店创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class DeliveryPickUpStoreCreateReqVO extends DeliveryPickUpStoreBaseVO {
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||||
|
import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeliveryPickUpStoreExcelVO {
|
||||||
|
|
||||||
|
@ExcelProperty("编号")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ExcelProperty("门店名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ExcelProperty("门店简介")
|
||||||
|
private String introduction;
|
||||||
|
|
||||||
|
@ExcelProperty("门店手机")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ExcelProperty("门店所在区域")
|
||||||
|
private String areaName;
|
||||||
|
|
||||||
|
@ExcelProperty("门店详细地址")
|
||||||
|
private String detailAddress;
|
||||||
|
|
||||||
|
@ExcelProperty("门店logo")
|
||||||
|
private String logo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* easy-excel 好像暂时不支持 LocalTime. 转成string
|
||||||
|
*/
|
||||||
|
@ExcelProperty("营业开始时间")
|
||||||
|
private String openingTime;
|
||||||
|
|
||||||
|
@ExcelProperty("营业结束时间")
|
||||||
|
private String closingTime;
|
||||||
|
|
||||||
|
@ExcelProperty("纬度")
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
@ExcelProperty("经度")
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||||
|
@DictFormat(DictTypeConstants.COMMON_STATUS)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
|
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_HOUR_MINUTE_SECOND;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 自提门店分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class DeliveryPickUpStorePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "门店名称", example = "李四")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "门店手机")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description = "区域编号", example = "18733")
|
||||||
|
private Integer areaId;
|
||||||
|
|
||||||
|
@Schema(description = "门店状态", example = "1")
|
||||||
|
@InEnum(CommonStatusEnum.class)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 自提门店 Response VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class DeliveryPickUpStoreRespVO extends DeliveryPickUpStoreBaseVO {
|
||||||
|
|
||||||
|
@Schema(description = "编号", required = true, example = "23128")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", required = true)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 自提门店更新 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class DeliveryPickUpStoreUpdateReqVO extends DeliveryPickUpStoreBaseVO {
|
||||||
|
|
||||||
|
@Schema(description = "编号", required = true, example = "23128")
|
||||||
|
@NotNull(message = "编号不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.convert.delivery;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.DeliveryPickUpStoreCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.DeliveryPickUpStoreExcelVO;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.DeliveryPickUpStoreRespVO;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.DeliveryPickUpStoreUpdateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryPickUpStoreDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.Mapping;
|
||||||
|
import org.mapstruct.Named;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface DeliveryPickUpStoreConvert {
|
||||||
|
|
||||||
|
DeliveryPickUpStoreConvert INSTANCE = Mappers.getMapper(DeliveryPickUpStoreConvert.class);
|
||||||
|
|
||||||
|
DeliveryPickUpStoreDO convert(DeliveryPickUpStoreCreateReqVO bean);
|
||||||
|
|
||||||
|
DeliveryPickUpStoreDO convert(DeliveryPickUpStoreUpdateReqVO bean);
|
||||||
|
|
||||||
|
DeliveryPickUpStoreRespVO convert(DeliveryPickUpStoreDO bean);
|
||||||
|
|
||||||
|
List<DeliveryPickUpStoreRespVO> convertList(List<DeliveryPickUpStoreDO> list);
|
||||||
|
|
||||||
|
PageResult<DeliveryPickUpStoreRespVO> convertPage(PageResult<DeliveryPickUpStoreDO> page);
|
||||||
|
|
||||||
|
List<DeliveryPickUpStoreExcelVO> convertList02(List<DeliveryPickUpStoreDO> list);
|
||||||
|
|
||||||
|
@Mapping(source = "areaId", target = "areaName", qualifiedByName = "convertAreaIdToName")
|
||||||
|
DeliveryPickUpStoreExcelVO convert2(DeliveryPickUpStoreDO bean);
|
||||||
|
|
||||||
|
@Named("convertAreaIdToName")
|
||||||
|
default String convertAreaIdToName(Integer areaId) {
|
||||||
|
return AreaUtils.format(areaId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.service.delivery;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.DeliveryPickUpStoreCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.DeliveryPickUpStoreExportReqVO;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.DeliveryPickUpStorePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.DeliveryPickUpStoreUpdateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryPickUpStoreDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自提门店 Service 接口
|
||||||
|
*
|
||||||
|
* @author jason
|
||||||
|
*/
|
||||||
|
public interface DeliveryPickUpStoreService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建自提门店
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createDeliveryPickUpStore(@Valid DeliveryPickUpStoreCreateReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新自提门店
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateDeliveryPickUpStore(@Valid DeliveryPickUpStoreUpdateReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除自提门店
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteDeliveryPickUpStore(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得自提门店
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 自提门店
|
||||||
|
*/
|
||||||
|
DeliveryPickUpStoreDO getDeliveryPickUpStore(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得自提门店列表
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
* @return 自提门店列表
|
||||||
|
*/
|
||||||
|
List<DeliveryPickUpStoreDO> getDeliveryPickUpStoreList(Collection<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得自提门店分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 自提门店分页
|
||||||
|
*/
|
||||||
|
PageResult<DeliveryPickUpStoreDO> getDeliveryPickUpStorePage(DeliveryPickUpStorePageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得自提门店列表, 用于 Excel 导出
|
||||||
|
*
|
||||||
|
* @param exportReqVO 查询条件
|
||||||
|
* @return 自提门店列表
|
||||||
|
*/
|
||||||
|
List<DeliveryPickUpStoreDO> getDeliveryPickUpStoreList(DeliveryPickUpStoreExportReqVO exportReqVO);
|
||||||
|
}
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
package cn.iocoder.yudao.module.trade.service.delivery;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.DeliveryPickUpStoreCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.DeliveryPickUpStoreExportReqVO;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.DeliveryPickUpStorePageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.pickup.DeliveryPickUpStoreUpdateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.trade.convert.delivery.DeliveryPickUpStoreConvert;
|
||||||
|
import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryPickUpStoreDO;
|
||||||
|
import cn.iocoder.yudao.module.trade.dal.mysql.delivery.DeliveryPickUpStoreMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自提门店 Service 实现类
|
||||||
|
*
|
||||||
|
* @author jason
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class DeliveryPickUpStoreServiceImpl implements DeliveryPickUpStoreService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DeliveryPickUpStoreMapper deliveryPickUpStoreMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createDeliveryPickUpStore(DeliveryPickUpStoreCreateReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
DeliveryPickUpStoreDO deliveryPickUpStore = DeliveryPickUpStoreConvert.INSTANCE.convert(createReqVO);
|
||||||
|
deliveryPickUpStoreMapper.insert(deliveryPickUpStore);
|
||||||
|
// 返回
|
||||||
|
return deliveryPickUpStore.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDeliveryPickUpStore(DeliveryPickUpStoreUpdateReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateDeliveryPickUpStoreExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
DeliveryPickUpStoreDO updateObj = DeliveryPickUpStoreConvert.INSTANCE.convert(updateReqVO);
|
||||||
|
deliveryPickUpStoreMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteDeliveryPickUpStore(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateDeliveryPickUpStoreExists(id);
|
||||||
|
// 删除
|
||||||
|
deliveryPickUpStoreMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateDeliveryPickUpStoreExists(Long id) {
|
||||||
|
if (deliveryPickUpStoreMapper.selectById(id) == null) {
|
||||||
|
throw exception(PICK_UP_STORE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DeliveryPickUpStoreDO getDeliveryPickUpStore(Long id) {
|
||||||
|
return deliveryPickUpStoreMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeliveryPickUpStoreDO> getDeliveryPickUpStoreList(Collection<Long> ids) {
|
||||||
|
return deliveryPickUpStoreMapper.selectBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<DeliveryPickUpStoreDO> getDeliveryPickUpStorePage(DeliveryPickUpStorePageReqVO pageReqVO) {
|
||||||
|
return deliveryPickUpStoreMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeliveryPickUpStoreDO> getDeliveryPickUpStoreList(DeliveryPickUpStoreExportReqVO exportReqVO) {
|
||||||
|
return deliveryPickUpStoreMapper.selectList(exportReqVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue