1. fix for new design
This commit is contained in:
2026-03-15 22:28:39 +08:00
parent e553a01f67
commit d66a3c762f
7 changed files with 73 additions and 33 deletions

View File

@@ -22,35 +22,36 @@ CREATE TABLE `kiosk_category`
DROP TABLE IF EXISTS `kiosk_price_list`; DROP TABLE IF EXISTS `kiosk_price_list`;
CREATE TABLE `kiosk_price_list` CREATE TABLE `kiosk_price_list`
( (
`id` bigint AUTO_INCREMENT NOT NULL COMMENT '主键', `id` bigint AUTO_INCREMENT NOT NULL COMMENT '主键',
`tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`category_id` bigint NOT NULL COMMENT 'cid', `category_id` bigint NOT NULL COMMENT 'cid',
`shape` int NULL DEFAULT 0 COMMENT '形状', `shape` int NULL DEFAULT 0 COMMENT '形状',
`material` int NULL DEFAULT 0 COMMENT '材质', `material` int NULL DEFAULT 0 COMMENT '材质',
`size` int NULL DEFAULT 0 COMMENT '尺寸', `size` int NULL DEFAULT 0 COMMENT '尺寸',
`size_description` varchar(255) NULL DEFAULT '' COMMENT '尺寸描述', `size_description` varchar(255) NULL DEFAULT '' COMMENT '尺寸描述',
`style` int NULL DEFAULT 0 COMMENT '风格', `style` int NULL DEFAULT 0 COMMENT '风格',
`currency` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '货币', `currency` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '货币',
`original_price` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '原价', `original_price` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '原价',
`actual_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '售价', `actual_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '售价',
`back_print` int NULL DEFAULT 1 COMMENT '背面打印', `back_print` int NULL DEFAULT 1 COMMENT '背面打印',
`back_print_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '背面打印价格', `back_print_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '背面打印价格',
`size_upgrade` int NULL DEFAULT 1 COMMENT '尺寸升级', `size_upgrade` int NULL DEFAULT 1 COMMENT '尺寸升级',
`size_upgrade_to` int NULL DEFAULT 0 COMMENT '尺寸升级至', `size_upgrade_to` int NULL DEFAULT 0 COMMENT '尺寸升级至',
`size_upgrade_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '尺寸升级价格', `size_upgrade_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '尺寸升级价格',
`stand` int NULL DEFAULT 1 COMMENT '支架', `stand` int NULL DEFAULT 1 COMMENT '支架',
`stand_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '支架价格', `stand_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '支架价格',
`material_upgrade` int NULL DEFAULT 1 COMMENT '材料升级', `material_upgrade` int NULL DEFAULT 1 COMMENT '材料升级',
`material_upgrade_to` int NULL DEFAULT 0 COMMENT '材料升级至', `material_upgrade_to` int NULL DEFAULT 0 COMMENT '材料升级至',
`material_upgrade_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '材料升级价格', `material_upgrade_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '材料升级价格',
`dept_id` bigint NULL DEFAULT -1 COMMENT '目标部门', `tag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '标签',
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人', `dept_id` bigint NULL DEFAULT -1 COMMENT '目标部门',
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', `create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',
`update_user` bigint NULL DEFAULT NULL COMMENT '修改人', `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间', `update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
`status` int NULL DEFAULT 1 COMMENT '状态', `update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除', `status` int NULL DEFAULT 1 COMMENT '状态',
`is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB ) ENGINE = InnoDB
CHARACTER SET = utf8mb4 CHARACTER SET = utf8mb4
@@ -129,10 +130,12 @@ CREATE TABLE `kiosk_order_detail`
`tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID', `tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
`order_id` bigint NOT NULL COMMENT 'oid', `order_id` bigint NOT NULL COMMENT 'oid',
`category_id` bigint NOT NULL COMMENT 'cid', `category_id` bigint NOT NULL COMMENT 'cid',
`price_list_id` bigint NOT NULL COMMENT 'pid',
`category_type` int NOT NULL DEFAULT 1 COMMENT '产品类型 1:单张 2:组合', `category_type` int NOT NULL DEFAULT 1 COMMENT '产品类型 1:单张 2:组合',
`category_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品名称', `category_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`material` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '材质', `material` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '材质',
`size` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '尺寸', `size` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '尺寸',
`tag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '标签',
`shape` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '形状', `shape` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '形状',
`style` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '风格', `style` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '风格',
`snapshot_link` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '快照地址', `snapshot_link` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '快照地址',
@@ -144,6 +147,7 @@ CREATE TABLE `kiosk_order_detail`
`size_upgrade` int NULL DEFAULT 2 COMMENT '尺寸升级', `size_upgrade` int NULL DEFAULT 2 COMMENT '尺寸升级',
`material_upgrade` int NULL DEFAULT 2 COMMENT '材料升级', `material_upgrade` int NULL DEFAULT 2 COMMENT '材料升级',
`stand` int NULL DEFAULT 2 COMMENT '支架', `stand` int NULL DEFAULT 2 COMMENT '支架',
`quantity` int NULL DEFAULT 2 COMMENT '数量',
`total_amount` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '总金额', `total_amount` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '总金额',
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人', `create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门', `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',

View File

@@ -26,6 +26,9 @@ public class OrderApiRequest implements Serializable {
@NotNull(message = "priceList is missing") @NotNull(message = "priceList is missing")
private Long priceList; private Long priceList;
@NotNull(message = "quantity is missing")
private Integer quantity;
@NotEmpty(message = "snapshot is missing") @NotEmpty(message = "snapshot is missing")
private Long snapshot; private Long snapshot;

View File

@@ -62,6 +62,11 @@ public class OrderDetailEntity extends TenantEntity {
*/ */
@Schema(description = "cid") @Schema(description = "cid")
private Long categoryId; private Long categoryId;
/**
* pid
*/
@Schema(description = "pid")
private Long priceListId;
/** /**
* 产品类型 1:单张 2:组合 * 产品类型 1:单张 2:组合
*/ */
@@ -82,6 +87,11 @@ public class OrderDetailEntity extends TenantEntity {
*/ */
@Schema(description = "尺寸") @Schema(description = "尺寸")
private String size; private String size;
/**
* 标签
*/
@Schema(description = "标签")
private String tag;
/** /**
* 形状 * 形状
*/ */
@@ -137,6 +147,11 @@ public class OrderDetailEntity extends TenantEntity {
*/ */
@Schema(description = "支架") @Schema(description = "支架")
private Integer stand; private Integer stand;
/**
* 数量
*/
@Schema(description = "数量")
private Integer quantity;
/** /**
* 总金额 * 总金额
*/ */

View File

@@ -156,5 +156,10 @@ public class PriceListEntity extends TenantEntity {
*/ */
@Schema(description = "目标部门") @Schema(description = "目标部门")
private Long deptId; private Long deptId;
/**
* 标签
*/
@Schema(description = "标签")
private String tag;
} }

View File

@@ -84,4 +84,6 @@ public class PriceListApiVO implements Serializable {
private BigDecimal standPrice; private BigDecimal standPrice;
private String tag;
} }

View File

@@ -154,6 +154,8 @@ public class PriceListVO extends TenantEntity {
@Schema(description = "目标部门") @Schema(description = "目标部门")
private Long deptId; private Long deptId;
private String tag;
private String categoryName; private String categoryName;
private String categoryType; private String categoryType;

View File

@@ -198,6 +198,9 @@ public class KioskServiceImpl implements IKioskApiService {
if (priceList == null) { if (priceList == null) {
throw new ServiceException("Invalid price."); throw new ServiceException("Invalid price.");
} }
detailAmount = detailAmount.add(priceList.getActualPrice());
orderDetail.setQuantity(item.getQuantity());
orderDetail.setTag(priceList.getTag());
CategoryEntity category = categoryService.getById(priceList.getCategoryId()); CategoryEntity category = categoryService.getById(priceList.getCategoryId());
if (category == null) { if (category == null) {
@@ -275,8 +278,8 @@ public class KioskServiceImpl implements IKioskApiService {
} }
orderDetail.setSnapshotLink(snapshotPhoto.getLink()); orderDetail.setSnapshotLink(snapshotPhoto.getLink());
orderDetail.setQuantity(item.getQuantity());
orderDetail.setTotalAmount(detailAmount.add(priceList.getActualPrice())); orderDetail.setTotalAmount(detailAmount.multiply(BigDecimal.valueOf(item.getQuantity())));
orderDetailService.save(orderDetail); orderDetailService.save(orderDetail);
totalAmount = totalAmount.add(orderDetail.getTotalAmount()); totalAmount = totalAmount.add(orderDetail.getTotalAmount());
@@ -395,6 +398,7 @@ public class KioskServiceImpl implements IKioskApiService {
vo.setMaterialUpgradePrice(p.getMaterialUpgradePrice()); vo.setMaterialUpgradePrice(p.getMaterialUpgradePrice());
vo.setStand(p.getStand() == 1 ? Boolean.TRUE : Boolean.FALSE); vo.setStand(p.getStand() == 1 ? Boolean.TRUE : Boolean.FALSE);
vo.setStandPrice(p.getStandPrice()); vo.setStandPrice(p.getStandPrice());
vo.setTag(p.getTag());
return vo; return vo;
}).toList(); }).toList();
} }
@@ -425,8 +429,13 @@ public class KioskServiceImpl implements IKioskApiService {
if (StringUtil.isNotBlank(request.getEmail()) && StringUtil.isNotBlank(order.getUserEmail())) { if (StringUtil.isNotBlank(request.getEmail()) && StringUtil.isNotBlank(order.getUserEmail())) {
throw new ServiceException("Email already exists."); throw new ServiceException("Email already exists.");
} }
order.setUserEmail(request.getEmail()); boolean match = RegexUtil.match(request.getEmail(), RegexUtil.EMAIL);
order.setUserPhone(request.getPhone()); if (match) {
order.setUserEmail(request.getEmail());
} else {
order.setUserPhone(request.getPhone());
}
// if (StringUtil.isNotBlank(request.getEmail())) { // if (StringUtil.isNotBlank(request.getEmail())) {
// emailService.sendHtmlEmail(request.getEmail(), order.getSerialNumber()); // emailService.sendHtmlEmail(request.getEmail(), order.getSerialNumber());
// } // }