mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 01:59:20 +08:00
feat(order): 订单字段信息硬编码,新增 GET /ec/order/fields 接口
- 新增 OrderFieldVO / OrderFieldConstants,替代动态库表字段 - OrderController 新增 /ec/order/fields 接口 - 前端导入向导和映射弹窗改用新接口
This commit is contained in:
+11
@@ -15,9 +15,13 @@ import top.xyquan.ecomdmbbackend.modules.ecom.order.model.dto.CreateOrderDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.order.model.dto.OrderFilterDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.order.model.dto.UpdateOrderDTO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.order.model.vo.BatchImportResultVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.order.model.vo.OrderFieldConstants;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.order.model.vo.OrderFieldVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.order.model.vo.OrderVO;
|
||||
import top.xyquan.ecomdmbbackend.modules.ecom.order.service.OrderService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单管理控制器
|
||||
*/
|
||||
@@ -91,4 +95,11 @@ public class OrderController {
|
||||
BatchImportResultVO result = orderService.batchImportOrders(batchImportOrderDTO);
|
||||
return ApiResponse.success("批量导入订单成功", result);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取订单字段信息列表", description = "获取订单导入的字段信息列表")
|
||||
@GetMapping("/fields")
|
||||
@RequirePermission(value = "ecom:order:read", description = "获取订单字段信息列表", allowSuper = true)
|
||||
public ApiResponse<List<OrderFieldVO>> getOrderFieldDefs() {
|
||||
return ApiResponse.success("获取订单字段信息列表成功", OrderFieldConstants.FIELDS);
|
||||
}
|
||||
}
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package top.xyquan.ecomdmbbackend.modules.ecom.order.model.vo;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单字段信息常量
|
||||
*/
|
||||
public class OrderFieldConstants {
|
||||
|
||||
public static final List<OrderFieldVO> FIELDS = Arrays.asList(
|
||||
create("spec_code", "规格编码", "商家编码-规格维度", true, 1, "string"),
|
||||
create("received_amount", "商家实收金额", "商家实收金额(元)", true, 2, "string"),
|
||||
create("product_quantity", "商品数量", "商品数量(件)", true, 3, "number"),
|
||||
create("order_time", "下单时间", "下单时间", true, 4, "string"),
|
||||
create("status", "订单状态", "订单状态", true, 5, "string"),
|
||||
create("product_code", "商品编码", "商家编码-商品维度", false, 6, "string"),
|
||||
create("link_product_name", "链接商品名称", "商品", true, 7, "string"),
|
||||
create("link_spec_name", "链接规格名称", "商品规格", true, 8, "string"),
|
||||
create("platform_order_no", "平台订单号", "订单号", true, 9, "string")
|
||||
);
|
||||
|
||||
private static OrderFieldVO create(String fieldName, String fieldLabel, String fileFieldName,
|
||||
boolean required, int sort, String dataType) {
|
||||
OrderFieldVO vo = new OrderFieldVO();
|
||||
vo.setFieldName(fieldName);
|
||||
vo.setFieldLabel(fieldLabel);
|
||||
vo.setFileFieldName(fileFieldName);
|
||||
vo.setRequired(required);
|
||||
vo.setSort(sort);
|
||||
vo.setDataType(dataType);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package top.xyquan.ecomdmbbackend.modules.ecom.order.model.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 订单字段信息VO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "订单字段信息VO")
|
||||
public class OrderFieldVO {
|
||||
|
||||
@Schema(description = "数据库字段名", example = "platform_order_no")
|
||||
private String fieldName;
|
||||
|
||||
@Schema(description = "中文字段名", example = "平台订单号")
|
||||
private String fieldLabel;
|
||||
|
||||
@Schema(description = "文件字段名", example = "订单号")
|
||||
private String fileFieldName;
|
||||
|
||||
@Schema(description = "是否必填", example = "true")
|
||||
private Boolean required;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "数据类型", example = "string")
|
||||
private String dataType;
|
||||
}
|
||||
Reference in New Issue
Block a user