Commit 53e9be733f71019d97a91ef1cc87053e1031c575

Authored by YunaiV
1 parent c62da6a0

mall:review + mall:快递公司管理

sql/mysql/optional/mall.sql
... ... @@ -330,9 +330,9 @@ CREATE TABLE `product_favorite` (
330 330 -- ----------------------------
331 331 DROP TABLE IF EXISTS `trade_delivery_express_template`;
332 332 CREATE TABLE `trade_delivery_express_template` (
333   - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号,自增',
  333 + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
334 334 `name` varchar(64) NOT NULL COMMENT '模板名称',
335   - `charge_mode` tinyint NOT NULL DEFAULT 1 COMMENT '配送计费方式 1:按件 2:按重量 3:按体积',
  335 + `charge_mode` tinyint NOT NULL COMMENT '配送计费方式',
336 336 `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
337 337 `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
338 338 `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
... ... @@ -348,11 +348,11 @@ CREATE TABLE `trade_delivery_express_template` (
348 348 -- ----------------------------
349 349 DROP TABLE IF EXISTS `trade_delivery_express_template_free`;
350 350 CREATE TABLE `trade_delivery_express_template_free` (
351   - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号,自增',
352   - `template_id` bigint NOT NULL COMMENT '配送模板编号, 对应delivery_template表id',
353   - `area_id` int NOT NULL COMMENT '包邮区域id',
354   - `free_price` int NOT NULL COMMENT '包邮金额(单位分) 订单总金额>包邮金额才免运费',
355   - `free_count` int NOT NULL DEFAULT 0 COMMENT '包邮件数,订单总件数>包邮件数才免运费',
  351 + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  352 + `template_id` bigint NOT NULL COMMENT '快递运费模板编号',
  353 + `area_id` int NOT NULL COMMENT '包邮区域 id',
  354 + `free_price` int NOT NULL COMMENT '包邮金额,单位:分',
  355 + `free_count` int NOT NULL DEFAULT 0 COMMENT '包邮件数,',
356 356 `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
357 357 `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
358 358 `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
... ... @@ -368,13 +368,13 @@ CREATE TABLE `trade_delivery_express_template_free` (
368 368 DROP TABLE IF EXISTS `trade_delivery_express_template_charge`;
369 369 CREATE TABLE `trade_delivery_express_template_charge` (
370 370 `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号,自增',
371   - `template_id` bigint NOT NULL COMMENT '配送模板编号, 对应delivery_template表id',
372   - `area_id` int NOT NULL COMMENT '配送区域id 1:适用于全国',
373   - `charge_mode` tinyint NOT NULL COMMENT '配送计费方式 1:按件 2:按重量 3:按体积',
374   - `start_count` double NOT NULL COMMENT '首件数量(件数,重量,或体积)',
375   - `start_price` int NOT NULL COMMENT '起步价(单位分)',
376   - `extra_count` double NOT NULL COMMENT '续件数量(件,重量,或体积)',
377   - `extra_price` int NOT NULL COMMENT '额外价(单位分)',
  371 + `template_id` bigint NOT NULL COMMENT '快递运费模板编号',
  372 + `area_id` int NOT NULL COMMENT '配送区域 id',
  373 + `charge_mode` tinyint NOT NULL COMMENT '配送计费方式',
  374 + `start_count` double NOT NULL COMMENT '首件数量',
  375 + `start_price` int NOT NULL COMMENT '起步价,单位:分',
  376 + `extra_count` double NOT NULL COMMENT '续件数量',
  377 + `extra_price` int NOT NULL COMMENT '额外价,单位:分',
378 378 `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
379 379 `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
380 380 `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
... ... @@ -417,7 +417,7 @@ DROP TABLE IF EXISTS `trade_delivery_pick_up_store_staff`;
417 417 CREATE TABLE `trade_delivery_pick_up_store_staff` (
418 418 `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号,自增',
419 419 store_id bigint NOT NULL COMMENT '自提门店编号',
420   - `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态(0正常 1停用)',
  420 + `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态',
421 421 `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
422 422 `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
423 423 `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
... ... @@ -451,12 +451,12 @@ CREATE TABLE `trade_delivery_pick_up_store_staff` (
451 451 -- ----------------------------
452 452 DROP TABLE IF EXISTS `trade_delivery_express`;
453 453 CREATE TABLE `trade_delivery_express` (
454   - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号,自增',
455   - `code` varchar(64) NOT NULL COMMENT '快递公司编号',
  454 + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  455 + `code` varchar(64) NOT NULL COMMENT '快递公司编码',
456 456 `name` varchar(64) NOT NULL COMMENT '快递公司名称',
457   - `logo` varchar(256) COMMENT '快递公司logo',
  457 + `logo` varchar(256) COMMENT '快递公司 logo',
458 458 `sort` int NOT NULL DEFAULT 0 COMMENT '排序',
459   - `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态(0正常 1停用)',
  459 + `status` tinyint NOT NULL DEFAULT 0 COMMENT '状态',
460 460 `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
461 461 `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
462 462 `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
... ... @@ -540,4 +540,4 @@ INSERT INTO `ruoyi-vue-pro`.`system_dict_type` (`id`, `name`, `type`, `status`,
540 540 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 (1237, 2, '按体积', '3', 'trade_delivery_express_charge_mode', 0, '', '', '', '1', '2023-05-21 22:47:18', '1', '2023-05-21 22:47:18', b'0');
541 541 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');
542 542 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');
543   -COMMIT;
544 543 \ No newline at end of file
  544 +COMMIT;
... ...
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/delivery/DeliveryExpressController.java
1 1 package cn.iocoder.yudao.module.trade.controller.admin.delivery;
2 2  
  3 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  4 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  5 +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
  6 +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
3 7 import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.*;
4 8 import cn.iocoder.yudao.module.trade.convert.delivery.DeliveryExpressConvert;
5 9 import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO;
6 10 import cn.iocoder.yudao.module.trade.service.delivery.DeliveryExpressService;
7   -import org.springframework.web.bind.annotation.*;
8   -import javax.annotation.Resource;
9   -import org.springframework.validation.annotation.Validated;
10   -import org.springframework.security.access.prepost.PreAuthorize;
11   -import io.swagger.v3.oas.annotations.tags.Tag;
12   -import io.swagger.v3.oas.annotations.Parameter;
13 11 import io.swagger.v3.oas.annotations.Operation;
  12 +import io.swagger.v3.oas.annotations.Parameter;
  13 +import io.swagger.v3.oas.annotations.tags.Tag;
  14 +import org.springframework.security.access.prepost.PreAuthorize;
  15 +import org.springframework.validation.annotation.Validated;
  16 +import org.springframework.web.bind.annotation.*;
14 17  
15   -import javax.validation.constraints.*;
16   -import javax.validation.*;
17   -import javax.servlet.http.*;
18   -import java.util.*;
  18 +import javax.annotation.Resource;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import javax.validation.Valid;
19 21 import java.io.IOException;
  22 +import java.util.List;
20 23  
21   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
22   -import cn.iocoder.yudao.framework.common.pojo.CommonResult;
23 24 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
24   -
25   -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
26   -
27   -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
28   -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
  25 +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
29 26  
30 27 @Tag(name = "管理后台 - 快递公司")
31 28 @RestController
... ...
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/delivery/vo/DeliveryExpressBaseVO.java
1 1 package cn.iocoder.yudao.module.trade.controller.admin.delivery.vo;
2 2  
3 3 import io.swagger.v3.oas.annotations.media.Schema;
4   -import lombok.*;
5   -import java.util.*;
6   -import java.time.LocalDateTime;
7   -import java.time.LocalDateTime;
8   -import javax.validation.constraints.*;
  4 +import lombok.Data;
  5 +
  6 +import javax.validation.constraints.NotNull;
9 7  
10 8 /**
11 9 * 快递公司 Base VO,提供给添加、修改、详细的子 VO 使用
... ... @@ -14,8 +12,8 @@ import javax.validation.constraints.*;
14 12 @Data
15 13 public class DeliveryExpressBaseVO {
16 14  
17   - @Schema(description = "快递公司编号", required = true)
18   - @NotNull(message = "快递公司编号不能为空")
  15 + @Schema(description = "快递公司编码", required = true)
  16 + @NotNull(message = "快递公司编码不能为空")
19 17 private String code;
20 18  
21 19 @Schema(description = "快递公司名称", required = true, example = "李四")
... ...
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/delivery/vo/DeliveryExpressExcelVO.java
... ... @@ -16,19 +16,20 @@ public class DeliveryExpressExcelVO {
16 16 @ExcelProperty("编号")
17 17 private Long id;
18 18  
19   - @ExcelProperty("快递公司编号")
  19 + @ExcelProperty("快递公司编码")
20 20 private String code;
21 21  
22 22 @ExcelProperty("快递公司名称")
23 23 private String name;
24 24  
25   - @ExcelProperty("快递公司logo")
  25 + @ExcelProperty("快递公司 logo")
26 26 private String logo;
27 27  
28 28 @ExcelProperty("排序")
29 29 private Integer sort;
30 30  
31   - @ExcelProperty("状态(0正常 1停用)")
  31 + @ExcelProperty("状态")
  32 + // TODO @jason:可以使用 @DictFormat(DictTypeConstants.COMMON_STATUS)
32 33 private Byte status;
33 34  
34 35 @ExcelProperty("创建时间")
... ...
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/delivery/vo/DeliveryExpressExportReqVO.java
... ... @@ -12,7 +12,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
12 12 @Data
13 13 public class DeliveryExpressExportReqVO {
14 14  
15   - @Schema(description = "快递公司编号")
  15 + @Schema(description = "快递公司编码")
16 16 private String code;
17 17  
18 18 @Schema(description = "快递公司名称", example = "李四")
... ...
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/delivery/vo/DeliveryExpressPageReqVO.java
... ... @@ -15,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
15 15 @ToString(callSuper = true)
16 16 public class DeliveryExpressPageReqVO extends PageParam {
17 17  
18   - @Schema(description = "快递公司编号")
  18 + @Schema(description = "快递公司编码")
19 19 private String code;
20 20  
21 21 @Schema(description = "快递公司名称", example = "李四")
... ...