Merge remote-tracking branch 'yudao/feature/mall_product' into feature/mall_product

# Conflicts:
#	yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/api/price/PriceApiImpl.java
#	yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/delivery/vo/expresstemplate/DeliveryExpressTemplateSimpleRespVO.java
This commit is contained in:
puhui999 2023-06-01 11:44:16 +08:00
commit e41935ea1d
30 changed files with 666 additions and 108 deletions

View File

@ -389,18 +389,18 @@ CREATE TABLE `trade_delivery_express_template_charge` (
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `trade_delivery_pick_up_store`; DROP TABLE IF EXISTS `trade_delivery_pick_up_store`;
CREATE TABLE `trade_delivery_pick_up_store` ( CREATE TABLE `trade_delivery_pick_up_store` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号自增', `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
`name` varchar(64) NOT NULL COMMENT '门店名称', `name` varchar(64) NOT NULL COMMENT '门店名称',
`introduction` varchar(256) COMMENT '门店简介', `introduction` varchar(256) COMMENT '门店简介',
`phone` varchar(16) NOT NULL COMMENT '门店手机', `phone` varchar(16) NOT NULL COMMENT '门店手机',
`area_id` int NOT NULL COMMENT '区域id', `area_id` int NOT NULL COMMENT '区域编号',
`detail_address` varchar(256) NOT NULL COMMENT '门店详细地址', `detail_address` varchar(256) NOT NULL COMMENT '门店详细地址',
`logo` varchar(256) NOT NULL COMMENT '门店 logo', `logo` varchar(256) NOT NULL COMMENT '门店 logo',
`opening_time` time NOT NULL COMMENT '营业开始时间', `opening_time` time NOT NULL COMMENT '营业开始时间',
`closing_time` time NOT NULL COMMENT '营业结束时间', `closing_time` time NOT NULL COMMENT '营业结束时间',
`latitude` varchar(128) NOT NULL COMMENT '纬度', `latitude` double NOT NULL COMMENT '纬度',
`longitude` varchar(128) NOT NULL COMMENT '经度', `longitude` double NOT NULL COMMENT '经度',
`status` tinyint NOT NULL DEFAULT 0 COMMENT '门店状态0正常 1停用', `status` tinyint NOT NULL DEFAULT 0 COMMENT '门店状态',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
@ -427,25 +427,6 @@ CREATE TABLE `trade_delivery_pick_up_store_staff` (
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB COMMENT='自提门店店员'; ) ENGINE=InnoDB COMMENT='自提门店店员';
-- ----------------------------
-- Table structure for trade_delivery_pick_up_store_staff
-- ----------------------------
DROP TABLE IF EXISTS `trade_delivery_pick_up_store_staff`;
CREATE TABLE `trade_delivery_pick_up_store_staff` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号自增',
`admin_user_id` bigint NOT NULL COMMENT '管理员用户id',
store_id bigint NOT NULL COMMENT '自提门店编号',
`status` tinyint NOT NULL DEFAULT 0 COMMENT '状态0正常 1停用',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB COMMENT='自提门店店员';
-- ---------------------------- -- ----------------------------
-- Table structure for trade_delivery_express -- Table structure for trade_delivery_express
-- ---------------------------- -- ----------------------------
@ -541,3 +522,15 @@ INSERT INTO `ruoyi-vue-pro`.`system_dict_data` (`id`, `sort`, `label`, `value`,
INSERT INTO `ruoyi-vue-pro`.`system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1236, 1, '按重量', '2', 'trade_delivery_express_charge_mode', 0, '', '', '', '1', '2023-05-21 22:46:58', '1', '2023-05-21 22:46:58', b'0'); INSERT INTO `ruoyi-vue-pro`.`system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1236, 1, '按重量', '2', 'trade_delivery_express_charge_mode', 0, '', '', '', '1', '2023-05-21 22:46:58', '1', '2023-05-21 22:46:58', b'0');
INSERT INTO `ruoyi-vue-pro`.`system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1235, 0, '按件', '1', 'trade_delivery_express_charge_mode', 0, '', '', '', '1', '2023-05-21 22:46:40', '1', '2023-05-21 22:46:40', b'0'); INSERT INTO `ruoyi-vue-pro`.`system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1235, 0, '按件', '1', 'trade_delivery_express_charge_mode', 0, '', '', '', '1', '2023-05-21 22:46:40', '1', '2023-05-21 22:46:40', b'0');
COMMIT; COMMIT;
-- ----------------------------
-- 门店管理 菜单
-- ----------------------------
BEGIN;
INSERT INTO `ruoyi-vue-pro`.`system_menu`(`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2179, '门店管理', '', 2, 1, 2166, 'pick-up-store', '', 'mall/trade/delivery/pickUpStore/index', 'PickUpStore', 0, b'1', b'1', b'1', '1', '2023-05-25 10:50:00', '1', '2023-05-25 10:50:00', b'0');
INSERT INTO `ruoyi-vue-pro`.`system_menu`(`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2180, '自提门店查询', 'trade:delivery:pick-up-store:query', 3, 1, 2179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-25 10:53:29', '', '2023-05-25 10:53:29', b'0');
INSERT INTO `ruoyi-vue-pro`.`system_menu`(`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2181, '自提门店创建', 'trade:delivery:pick-up-store:create', 3, 2, 2179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-25 10:53:29', '', '2023-05-25 10:53:29', b'0');
INSERT INTO `ruoyi-vue-pro`.`system_menu`(`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2182, '自提门店更新', 'trade:delivery:pick-up-store:update', 3, 3, 2179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-25 10:53:29', '', '2023-05-25 10:53:29', b'0');
INSERT INTO `ruoyi-vue-pro`.`system_menu`(`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2183, '自提门店删除', 'trade:delivery:pick-up-store:delete', 3, 4, 2179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-25 10:53:29', '', '2023-05-25 10:53:29', b'0');
INSERT INTO `ruoyi-vue-pro`.`system_menu`(`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2184, '自提门店导出', 'trade:delivery:pick-up-store:export', 3, 5, 2179, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-05-25 10:53:29', '', '2023-05-25 10:53:29', b'0');
COMMIT;

View File

@ -47,9 +47,11 @@ public interface ErrorCodeConstants {
// ========== 物流配送模块 1011003000 ========== // ========== 物流配送模块 1011003000 ==========
ErrorCode DELIVERY_EXPRESS_NOT_EXISTS = new ErrorCode(1011003000, "快递公司不存在"); ErrorCode DELIVERY_EXPRESS_NOT_EXISTS = new ErrorCode(1011003000, "快递公司不存在");
// TODO @jason最好每个模块一段哈express 一个exmpresstemplate 一个pickup 一个
ErrorCode EXPRESS_CODE_DUPLICATE = new ErrorCode(1011003001, "已经存在该编码的快递公司"); ErrorCode EXPRESS_CODE_DUPLICATE = new ErrorCode(1011003001, "已经存在该编码的快递公司");
ErrorCode EXPRESS_TEMPLATE_NOT_EXISTS = new ErrorCode(1011003002, "运费模板不存在"); ErrorCode EXPRESS_TEMPLATE_NOT_EXISTS = new ErrorCode(1011003002, "运费模板不存在");
ErrorCode EXPRESS_TEMPLATE_NAME_DUPLICATE = new ErrorCode(1011003002, "已经存在该运费模板名"); ErrorCode EXPRESS_TEMPLATE_NAME_DUPLICATE = new ErrorCode(1011003002, "已经存在该运费模板名");
ErrorCode PICK_UP_STORE_NOT_EXISTS = new ErrorCode(1011003003, "自提门店不存在");
// ========== Price 相关 1011004000 ============ // ========== Price 相关 1011004000 ============
ErrorCode PRICE_CALCULATE_PAY_PRICE_ILLEGAL = new ErrorCode(1011004000, "支付价格计算异常,原因:价格小于等于 0"); ErrorCode PRICE_CALCULATE_PAY_PRICE_ILLEGAL = new ErrorCode(1011004000, "支付价格计算异常,原因:价格小于等于 0");

View File

@ -75,7 +75,6 @@ public class DeliveryExpressController {
return success(DeliveryExpressConvert.INSTANCE.convertPage(pageResult)); return success(DeliveryExpressConvert.INSTANCE.convertPage(pageResult));
} }
// TODO @jason运费模版@芋艿 你的意思是运费模板导出没有必要吧已经去掉了这个是快递公司导出
@GetMapping("/export-excel") @GetMapping("/export-excel")
@Operation(summary = "导出快递公司 Excel") @Operation(summary = "导出快递公司 Excel")
@PreAuthorize("@ss.hasPermission('trade:delivery:express:export')") @PreAuthorize("@ss.hasPermission('trade:delivery:express:export')")
@ -87,5 +86,4 @@ public class DeliveryExpressController {
List<DeliveryExpressExcelVO> dataList = DeliveryExpressConvert.INSTANCE.convertList02(list); List<DeliveryExpressExcelVO> dataList = DeliveryExpressConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "快递公司.xls", "数据", DeliveryExpressExcelVO.class, dataList); ExcelUtils.write(response, "快递公司.xls", "数据", DeliveryExpressExcelVO.class, dataList);
} }
} }

View File

@ -21,7 +21,6 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 快递运费模板") @Tag(name = "管理后台 - 快递运费模板")
@RestController @RestController
@RequestMapping("/trade/delivery/express-template") @RequestMapping("/trade/delivery/express-template")

View File

@ -0,0 +1,99 @@
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));
}
// TODO @jason导出去掉好列简化下一般用不到哈
@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);
}
}

View File

@ -27,8 +27,8 @@ public class DeliveryExpressBaseVO {
@NotNull(message = "排序不能为空") @NotNull(message = "排序不能为空")
private Integer sort; private Integer sort;
@Schema(description = "状态0正常 1停用", required = true, example = "1") @Schema(description = "状态", required = true, example = "1")
@NotNull(message = "状态0正常 1停用不能为空") @NotNull(message = "状态不能为空")
private Integer status; private Integer status;
} }

View File

@ -15,14 +15,12 @@ import java.util.List;
@ToString(callSuper = true) @ToString(callSuper = true)
public class DeliveryExpressTemplateCreateReqVO extends DeliveryExpressTemplateBaseVO { public class DeliveryExpressTemplateCreateReqVO extends DeliveryExpressTemplateBaseVO {
// TODO @jason不用给默认值哈
@Schema(description = "区域运费列表") @Schema(description = "区域运费列表")
@Valid @Valid
private List<ExpressTemplateChargeBaseVO> templateCharge = Collections.emptyList(); private List<ExpressTemplateChargeBaseVO> templateCharge;
@Schema(description = "包邮区域列表") @Schema(description = "包邮区域列表")
@Valid @Valid
private List<ExpressTemplateFreeBaseVO> templateFree = Collections.emptyList(); private List<ExpressTemplateFreeBaseVO> templateFree;
} }

View File

@ -2,19 +2,20 @@ package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.expresstempla
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
// TODO @jasonsimplae 是不是不用继承 DeliveryExpressTemplateBaseVO直接 id name 属性就够了
// @芋艿 这里给列表显示用的 需要显示计费方式和排序 所以继承 DeliveryExpressTemplateBaseVO 这是去掉了包邮区域和 区域运费列表
@Schema(description = "管理后台 - 快递运费模板 精简 Response VO") @Schema(description = "管理后台 - 快递运费模板 精简 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true) @ToString(callSuper = true)
public class DeliveryExpressTemplateSimpleRespVO { public class DeliveryExpressTemplateSimpleRespVO extends DeliveryExpressTemplateBaseVO {
@Schema(description = "编号,自增", required = true, example = "371") @Schema(description = "编号,自增", required = true, example = "371")
private Long id; private Long id;
@Schema(description = "模板名称", required = true, example = "王五") @Schema(description = "创建时间", required = true)
private String name; private LocalDateTime createTime;
} }

View File

@ -7,7 +7,6 @@ import lombok.ToString;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Collections;
import java.util.List; import java.util.List;
@Schema(description = "管理后台 - 快递运费模板更新 Request VO") @Schema(description = "管理后台 - 快递运费模板更新 Request VO")
@ -20,14 +19,38 @@ public class DeliveryExpressTemplateUpdateReqVO extends DeliveryExpressTemplateB
@NotNull(message = "编号不能为空") @NotNull(message = "编号不能为空")
private Long id; private Long id;
// TODO @jasonpojo 不给默认值哈
@Schema(description = "区域运费列表") @Schema(description = "区域运费列表")
@Valid @Valid
private List<ExpressTemplateChargeUpdateVO> templateCharge = Collections.emptyList(); private List<ExpressTemplateChargeUpdateVO> templateCharge;
@Schema(description = "包邮区域列表") @Schema(description = "包邮区域列表")
@Valid @Valid
private List<ExpressTemplateFreeUpdateVO> templateFree = Collections.emptyList(); private List<ExpressTemplateFreeUpdateVO> templateFree;
@Schema(description = "管理后台 - 快递运费模板区域运费更新 Request VO")
@Data
public static class ExpressTemplateChargeUpdateVO extends ExpressTemplateChargeBaseVO {
@Schema(description = "编号", example = "6592")
private Long id;
// TODO @jason这几个字段应该不通过前端传递而是后端查询后去赋值的
@Schema(description = "配送模板编号", example = "1")
private Long templateId;
@Schema(description = "配送计费方式", example = "1")
private Integer chargeMode;
} }
@Schema(description = "管理后台 - 快递运费模板包邮区域更新 Request VO")
@Data
public static class ExpressTemplateFreeUpdateVO extends ExpressTemplateFreeBaseVO {
@Schema(description = "编号", example = "6592")
private Long id;
@Schema(description = "配送模板编号", example = "1")
private Long templateId;
}
}

View File

@ -1,22 +0,0 @@
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.expresstemplate;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
// TODO @jason这个 vo 可以内嵌到 DeliveryExpressTemplateUpdateReqVO避免 vo 过多不好分辨
@Schema(description = "管理后台 - 快递公司创建 Request VO")
@Data
public class ExpressTemplateChargeUpdateVO extends ExpressTemplateChargeBaseVO {
@Schema(description = "编号", example = "6592")
private Long id;
// TODO @jason这几个字段应该不通过前端传递而是后端查询后去赋值的
@Schema(description = "配送模板编号", example = "1")
private Long templateId;
@Schema(description = "配送计费方式", example = "1")
private Integer chargeMode;
}

View File

@ -1,19 +0,0 @@
package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.expresstemplate;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
// TODO @jason这个 vo 可以内嵌到 DeliveryExpressTemplateUpdateReqVO避免 vo 过多不好分辨
// TODO @jasonswagger 缺失
/**
* 快递运费模板包邮 更新 VO
*/
@Data
public class ExpressTemplateFreeUpdateVO extends ExpressTemplateFreeBaseVO {
@Schema(description = "编号", example = "6592")
private Long id;
@Schema(description = "配送模板编号", example = "1")
private Long templateId;
}

View File

@ -0,0 +1,68 @@
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 cn.iocoder.yudao.framework.common.validation.Mobile;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalTime;
/**
* 自提门店 Base VO提供给添加修改详细的子 VO 使用
* 如果子 VO 存在差异的字段请不要添加到这里影响 Swagger 文档生成
*/
@Data
public class DeliveryPickUpStoreBaseVO {
@Schema(description = "门店名称", required = true, example = "李四")
@NotBlank(message = "门店名称不能为空")
private String name;
@Schema(description = "门店简介", example = "我是门店简介")
private String introduction;
@Schema(description = "门店手机", required = true, example = "15601892312")
@NotBlank(message = "门店手机不能为空")
@Mobile
private String phone;
@Schema(description = "区域编号", required = true, example = "18733")
@NotNull(message = "区域编号不能为空")
private Integer areaId;
@Schema(description = "门店详细地址", required = true, example = "复旦大学路 188 号")
@NotBlank(message = "门店详细地址不能为空")
private String detailAddress;
@Schema(description = "门店 logo", required = true, example = "https://www.iocoder.cn/1.png")
@NotBlank(message = "门店 logo 不能为空")
private String logo;
@Schema(description = "营业开始时间", required = true)
@NotNull(message = "营业开始时间不能为空")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm")
private LocalTime openingTime;
@Schema(description = "营业结束时间", required = true)
@NotNull(message = "营业结束时间不能为空")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm")
private LocalTime closingTime;
@Schema(description = "纬度", required = true, example = "5.88")
@NotNull(message = "纬度不能为空")
private Double latitude;
@Schema(description = "经度", required = true, example = "6.99")
@NotNull(message = "经度不能为空")
private Double longitude;
@Schema(description = "门店状态", required = true, example = "1")
@NotNull(message = "门店状态不能为空")
@InEnum(CommonStatusEnum.class)
private Integer status;
}

View File

@ -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 {
}

View File

@ -0,0 +1,58 @@
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;
// TODO @jason是不是可以加个 convert
/**
* 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;
}

View File

@ -0,0 +1,34 @@
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 io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 自提门店 Excel 导出 Request VO参数和 DeliveryPickUpStorePageReqVO 是一致的")
@Data
public class DeliveryPickUpStoreExportReqVO {
@Schema(description = "门店名称", example = "李四")
private String name;
@Schema(description = "门店手机")
private String phone;
@Schema(description = "区域id", 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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -55,6 +55,9 @@ public class AppTradeOrderController {
@PreAuthenticated @PreAuthenticated
public CommonResult<AppTradeOrderSettlementRespVO> settlementOrder( public CommonResult<AppTradeOrderSettlementRespVO> settlementOrder(
@Valid AppTradeOrderSettlementReqVO settlementReqVO) { @Valid AppTradeOrderSettlementReqVO settlementReqVO) {
if (true) {
return success(tradeOrderService.settlementOrder(getLoginUserId(), settlementReqVO));
}
// return success(tradeOrderService.getOrderConfirmCreateInfo(UserSecurityContextHolder.getUserId(), skuId, quantity, couponCardId)); // return success(tradeOrderService.getOrderConfirmCreateInfo(UserSecurityContextHolder.getUserId(), skuId, quantity, couponCardId));
AppTradeOrderSettlementRespVO settlement = new AppTradeOrderSettlementRespVO(); AppTradeOrderSettlementRespVO settlement = new AppTradeOrderSettlementRespVO();

View File

@ -77,7 +77,7 @@ public class AppTradeOrderSettlementRespVO {
} }
@Schema(description = "费用(合计)") @Schema(description = "地址信息")
@Data @Data
public static class Address { public static class Address {

View File

@ -12,12 +12,6 @@ import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
/**
* 快递公司 Convert
*
* @author jason
*/
@Mapper @Mapper
public interface DeliveryExpressConvert { public interface DeliveryExpressConvert {

View File

@ -11,11 +11,6 @@ import org.mapstruct.factory.Mappers;
import java.util.List; import java.util.List;
/**
* 快递运费模板 Convert
*
* @author jason
*/
@Mapper @Mapper
public interface DeliveryExpressTemplateConvert { public interface DeliveryExpressTemplateConvert {
@ -48,7 +43,7 @@ public interface DeliveryExpressTemplateConvert {
DeliveryExpressTemplateChargeDO convertTemplateCharge(Long templateId, Integer chargeMode, ExpressTemplateChargeBaseVO vo); DeliveryExpressTemplateChargeDO convertTemplateCharge(Long templateId, Integer chargeMode, ExpressTemplateChargeBaseVO vo);
DeliveryExpressTemplateChargeDO convertTemplateCharge(ExpressTemplateChargeUpdateVO vo); DeliveryExpressTemplateChargeDO convertTemplateCharge(DeliveryExpressTemplateUpdateReqVO.ExpressTemplateChargeUpdateVO vo);
default List<DeliveryExpressTemplateChargeDO> convertTemplateChargeList(Long templateId, Integer chargeMode, List<ExpressTemplateChargeBaseVO> list) { default List<DeliveryExpressTemplateChargeDO> convertTemplateChargeList(Long templateId, Integer chargeMode, List<ExpressTemplateChargeBaseVO> list) {
return CollectionUtils.convertList(list, vo -> convertTemplateCharge(templateId, chargeMode, vo)); return CollectionUtils.convertList(list, vo -> convertTemplateCharge(templateId, chargeMode, vo));
@ -58,7 +53,7 @@ public interface DeliveryExpressTemplateConvert {
DeliveryExpressTemplateFreeDO convertTemplateFree(Long templateId, ExpressTemplateFreeBaseVO vo); DeliveryExpressTemplateFreeDO convertTemplateFree(Long templateId, ExpressTemplateFreeBaseVO vo);
DeliveryExpressTemplateFreeDO convertTemplateFree(ExpressTemplateFreeUpdateVO vo); DeliveryExpressTemplateFreeDO convertTemplateFree(DeliveryExpressTemplateUpdateReqVO.ExpressTemplateFreeUpdateVO vo);
List<ExpressTemplateChargeBaseVO> convertTemplateChargeList(List<DeliveryExpressTemplateChargeDO> list); List<ExpressTemplateChargeBaseVO> convertTemplateChargeList(List<DeliveryExpressTemplateChargeDO> list);

View File

@ -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);
}
}

View File

@ -20,7 +20,7 @@ import java.time.LocalTime;
public class DeliveryPickUpStoreDO extends BaseDO { public class DeliveryPickUpStoreDO extends BaseDO {
/** /**
* 编号自增 * 编号
*/ */
@TableId @TableId
private Long id; private Long id;
@ -41,7 +41,7 @@ public class DeliveryPickUpStoreDO extends BaseDO {
private String phone; private String phone;
/** /**
* 区域 id * 区域编号
*/ */
private Integer areaId; private Integer areaId;
@ -59,20 +59,20 @@ public class DeliveryPickUpStoreDO extends BaseDO {
* 营业开始时间 * 营业开始时间
*/ */
private LocalTime openingTime; private LocalTime openingTime;
/** /**
* 营业结束时间 * 营业结束时间
*/ */
private LocalTime closingTime; private LocalTime closingTime;
// TODO @Jason应该是 double
/** /**
* 纬度 * 纬度
*/ */
private String latitude; private Double latitude;
/** /**
* 经度 * 经度
*/ */
private String longitude; private Double longitude;
/** /**
* 门店状态 * 门店状态

View File

@ -1,11 +1,37 @@
package cn.iocoder.yudao.module.trade.dal.mysql.delivery; package cn.iocoder.yudao.module.trade.dal.mysql.delivery;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
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.dal.dataobject.delivery.DeliveryPickUpStoreDO; import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryPickUpStoreDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper @Mapper
public interface DeliveryPickUpStoreMapper extends BaseMapperX<DeliveryPickUpStoreDO> { public interface DeliveryPickUpStoreMapper extends BaseMapperX<DeliveryPickUpStoreDO> {
default PageResult<DeliveryPickUpStoreDO> selectPage(DeliveryPickUpStorePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<DeliveryPickUpStoreDO>()
.likeIfPresent(DeliveryPickUpStoreDO::getName, reqVO.getName())
.eqIfPresent(DeliveryPickUpStoreDO::getPhone, reqVO.getPhone())
.eqIfPresent(DeliveryPickUpStoreDO::getAreaId, reqVO.getAreaId())
.eqIfPresent(DeliveryPickUpStoreDO::getStatus, reqVO.getStatus())
.betweenIfPresent(DeliveryPickUpStoreDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(DeliveryPickUpStoreDO::getId));
}
default List<DeliveryPickUpStoreDO> selectList(DeliveryPickUpStoreExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<DeliveryPickUpStoreDO>()
.likeIfPresent(DeliveryPickUpStoreDO::getName, reqVO.getName())
.eqIfPresent(DeliveryPickUpStoreDO::getPhone, reqVO.getPhone())
.eqIfPresent(DeliveryPickUpStoreDO::getAreaId, reqVO.getAreaId())
.eqIfPresent(DeliveryPickUpStoreDO::getStatus, reqVO.getStatus())
.betweenIfPresent(DeliveryPickUpStoreDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(DeliveryPickUpStoreDO::getId));
}
} }

View File

@ -82,10 +82,10 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
private void updateExpressTemplateFree(DeliveryExpressTemplateUpdateReqVO updateReqVO) { private void updateExpressTemplateFree(DeliveryExpressTemplateUpdateReqVO updateReqVO) {
// 1.1 获得新增/修改的区域列表 // 1.1 获得新增/修改的区域列表
List<DeliveryExpressTemplateFreeDO> oldFreeList = expressTemplateFreeMapper.selectListByTemplateId(updateReqVO.getId()); List<DeliveryExpressTemplateFreeDO> oldFreeList = expressTemplateFreeMapper.selectListByTemplateId(updateReqVO.getId());
List<ExpressTemplateFreeUpdateVO> newFreeList = updateReqVO.getTemplateFree(); List<DeliveryExpressTemplateUpdateReqVO.ExpressTemplateFreeUpdateVO> newFreeList = updateReqVO.getTemplateFree();
List<DeliveryExpressTemplateFreeDO> addFreeList = new ArrayList<>(newFreeList.size()); // 新增包邮区域列表 List<DeliveryExpressTemplateFreeDO> addFreeList = new ArrayList<>(newFreeList.size()); // 新增包邮区域列表
List<DeliveryExpressTemplateFreeDO> updateFreeList = new ArrayList<>(newFreeList.size()); // 更新包邮区域列表 List<DeliveryExpressTemplateFreeDO> updateFreeList = new ArrayList<>(newFreeList.size()); // 更新包邮区域列表
for (ExpressTemplateFreeUpdateVO item : newFreeList) { for (DeliveryExpressTemplateUpdateReqVO.ExpressTemplateFreeUpdateVO item : newFreeList) {
if (Objects.nonNull(item.getId())) { if (Objects.nonNull(item.getId())) {
updateFreeList.add(INSTANCE.convertTemplateFree(item)); updateFreeList.add(INSTANCE.convertTemplateFree(item));
} else { } else {
@ -113,10 +113,10 @@ public class DeliveryExpressTemplateServiceImpl implements DeliveryExpressTempla
private void updateExpressTemplateCharge(DeliveryExpressTemplateUpdateReqVO updateReqVO) { private void updateExpressTemplateCharge(DeliveryExpressTemplateUpdateReqVO updateReqVO) {
// 1.1 获得新增/修改的区域列表 // 1.1 获得新增/修改的区域列表
List<DeliveryExpressTemplateChargeDO> oldChargeList = expressTemplateChargeMapper.selectListByTemplateId(updateReqVO.getId()); List<DeliveryExpressTemplateChargeDO> oldChargeList = expressTemplateChargeMapper.selectListByTemplateId(updateReqVO.getId());
List<ExpressTemplateChargeUpdateVO> newChargeList = updateReqVO.getTemplateCharge(); List<DeliveryExpressTemplateUpdateReqVO.ExpressTemplateChargeUpdateVO> newChargeList = updateReqVO.getTemplateCharge();
List<DeliveryExpressTemplateChargeDO> addList = new ArrayList<>(newChargeList.size()); // 新增运费区域列表 List<DeliveryExpressTemplateChargeDO> addList = new ArrayList<>(newChargeList.size()); // 新增运费区域列表
List<DeliveryExpressTemplateChargeDO> updateList = new ArrayList<>(newChargeList.size()); // 更新运费区域列表 List<DeliveryExpressTemplateChargeDO> updateList = new ArrayList<>(newChargeList.size()); // 更新运费区域列表
for (ExpressTemplateChargeUpdateVO item : newChargeList) { for (DeliveryExpressTemplateUpdateReqVO.ExpressTemplateChargeUpdateVO item : newChargeList) {
if (item.getId() != null) { if (item.getId() != null) {
// 计费模式以主表为准 // 计费模式以主表为准
item.setChargeMode(updateReqVO.getChargeMode()); item.setChargeMode(updateReqVO.getChargeMode());

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -5,6 +5,8 @@ import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderDeliver
import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderPageReqVO; import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderPageReqVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderCreateReqVO; import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderCreateReqVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderPageReqVO; import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderPageReqVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderSettlementReqVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderSettlementRespVO;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO;
@ -23,6 +25,15 @@ public interface TradeOrderService {
// =================== Order =================== // =================== Order ===================
/**
* 获得订单结算信息
*
* @param userId 登录用户
* @param settlementReqVO 订单结算请求
* @return 订单结算结果
*/
AppTradeOrderSettlementRespVO settlementOrder(Long userId, AppTradeOrderSettlementReqVO settlementReqVO);
/** /**
* 会员创建交易订单 * 会员创建交易订单
* *

View File

@ -31,6 +31,8 @@ import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderDeliver
import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderPageReqVO; import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderPageReqVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderCreateReqVO; import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderCreateReqVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderPageReqVO; import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderPageReqVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderSettlementReqVO;
import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderSettlementRespVO;
import cn.iocoder.yudao.module.trade.convert.order.TradeOrderConvert; import cn.iocoder.yudao.module.trade.convert.order.TradeOrderConvert;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO;
@ -88,6 +90,11 @@ public class TradeOrderServiceImpl implements TradeOrderService {
// =================== Order =================== // =================== Order ===================
@Override
public AppTradeOrderSettlementRespVO settlementOrder(Long userId, AppTradeOrderSettlementReqVO settlementReqVO) {
return null;
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Long createOrder(Long userId, String userIp, AppTradeOrderCreateReqVO createReqVO) { public Long createOrder(Long userId, String userIp, AppTradeOrderCreateReqVO createReqVO) {