update:
1. fix for new design
This commit is contained in:
@@ -22,35 +22,36 @@ CREATE TABLE `kiosk_category`
|
||||
DROP TABLE IF EXISTS `kiosk_price_list`;
|
||||
CREATE TABLE `kiosk_price_list`
|
||||
(
|
||||
`id` bigint AUTO_INCREMENT NOT NULL COMMENT '主键',
|
||||
`tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
|
||||
`category_id` bigint NOT NULL COMMENT 'cid',
|
||||
`shape` int NULL DEFAULT 0 COMMENT '形状',
|
||||
`material` int NULL DEFAULT 0 COMMENT '材质',
|
||||
`size` int NULL DEFAULT 0 COMMENT '尺寸',
|
||||
`size_description` varchar(255) NULL DEFAULT '' COMMENT '尺寸描述',
|
||||
`style` int NULL DEFAULT 0 COMMENT '风格',
|
||||
`currency` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '货币',
|
||||
`original_price` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '原价',
|
||||
`actual_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '售价',
|
||||
`back_print` int NULL DEFAULT 1 COMMENT '背面打印',
|
||||
`back_print_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '背面打印价格',
|
||||
`size_upgrade` int NULL DEFAULT 1 COMMENT '尺寸升级',
|
||||
`size_upgrade_to` int NULL DEFAULT 0 COMMENT '尺寸升级至',
|
||||
`size_upgrade_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '尺寸升级价格',
|
||||
`stand` int NULL DEFAULT 1 COMMENT '支架',
|
||||
`stand_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '支架价格',
|
||||
`material_upgrade` int NULL DEFAULT 1 COMMENT '材料升级',
|
||||
`material_upgrade_to` int NULL DEFAULT 0 COMMENT '材料升级至',
|
||||
`material_upgrade_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '材料升级价格',
|
||||
`dept_id` bigint NULL DEFAULT -1 COMMENT '目标部门',
|
||||
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
|
||||
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
|
||||
`status` int NULL DEFAULT 1 COMMENT '状态',
|
||||
`is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除',
|
||||
`id` bigint AUTO_INCREMENT NOT NULL COMMENT '主键',
|
||||
`tenant_id` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '000000' COMMENT '租户ID',
|
||||
`category_id` bigint NOT NULL COMMENT 'cid',
|
||||
`shape` int NULL DEFAULT 0 COMMENT '形状',
|
||||
`material` int NULL DEFAULT 0 COMMENT '材质',
|
||||
`size` int NULL DEFAULT 0 COMMENT '尺寸',
|
||||
`size_description` varchar(255) NULL DEFAULT '' COMMENT '尺寸描述',
|
||||
`style` int NULL DEFAULT 0 COMMENT '风格',
|
||||
`currency` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '货币',
|
||||
`original_price` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '原价',
|
||||
`actual_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '售价',
|
||||
`back_print` int NULL DEFAULT 1 COMMENT '背面打印',
|
||||
`back_print_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '背面打印价格',
|
||||
`size_upgrade` int NULL DEFAULT 1 COMMENT '尺寸升级',
|
||||
`size_upgrade_to` int NULL DEFAULT 0 COMMENT '尺寸升级至',
|
||||
`size_upgrade_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '尺寸升级价格',
|
||||
`stand` int NULL DEFAULT 1 COMMENT '支架',
|
||||
`stand_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '支架价格',
|
||||
`material_upgrade` int NULL DEFAULT 1 COMMENT '材料升级',
|
||||
`material_upgrade_to` int NULL DEFAULT 0 COMMENT '材料升级至',
|
||||
`material_upgrade_price` decimal(10, 2) NULL DEFAULT 0 COMMENT '材料升级价格',
|
||||
`tag` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '标签',
|
||||
`dept_id` bigint NULL DEFAULT -1 COMMENT '目标部门',
|
||||
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
|
||||
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_user` bigint NULL DEFAULT NULL COMMENT '修改人',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
|
||||
`status` int NULL DEFAULT 1 COMMENT '状态',
|
||||
`is_deleted` int NULL DEFAULT 0 COMMENT '是否已删除',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB
|
||||
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',
|
||||
`order_id` bigint NOT NULL COMMENT 'oid',
|
||||
`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_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 '材质',
|
||||
`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 '形状',
|
||||
`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 '快照地址',
|
||||
@@ -144,6 +147,7 @@ CREATE TABLE `kiosk_order_detail`
|
||||
`size_upgrade` int NULL DEFAULT 2 COMMENT '尺寸升级',
|
||||
`material_upgrade` 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 '总金额',
|
||||
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
|
||||
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',
|
||||
|
||||
@@ -26,6 +26,9 @@ public class OrderApiRequest implements Serializable {
|
||||
@NotNull(message = "priceList is missing")
|
||||
private Long priceList;
|
||||
|
||||
@NotNull(message = "quantity is missing")
|
||||
private Integer quantity;
|
||||
|
||||
@NotEmpty(message = "snapshot is missing")
|
||||
private Long snapshot;
|
||||
|
||||
|
||||
@@ -62,6 +62,11 @@ public class OrderDetailEntity extends TenantEntity {
|
||||
*/
|
||||
@Schema(description = "cid")
|
||||
private Long categoryId;
|
||||
/**
|
||||
* pid
|
||||
*/
|
||||
@Schema(description = "pid")
|
||||
private Long priceListId;
|
||||
/**
|
||||
* 产品类型 1:单张 2:组合
|
||||
*/
|
||||
@@ -82,6 +87,11 @@ public class OrderDetailEntity extends TenantEntity {
|
||||
*/
|
||||
@Schema(description = "尺寸")
|
||||
private String size;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@Schema(description = "标签")
|
||||
private String tag;
|
||||
/**
|
||||
* 形状
|
||||
*/
|
||||
@@ -137,6 +147,11 @@ public class OrderDetailEntity extends TenantEntity {
|
||||
*/
|
||||
@Schema(description = "支架")
|
||||
private Integer stand;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Schema(description = "数量")
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 总金额
|
||||
*/
|
||||
|
||||
@@ -156,5 +156,10 @@ public class PriceListEntity extends TenantEntity {
|
||||
*/
|
||||
@Schema(description = "目标部门")
|
||||
private Long deptId;
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@Schema(description = "标签")
|
||||
private String tag;
|
||||
|
||||
}
|
||||
|
||||
@@ -84,4 +84,6 @@ public class PriceListApiVO implements Serializable {
|
||||
|
||||
private BigDecimal standPrice;
|
||||
|
||||
private String tag;
|
||||
|
||||
}
|
||||
|
||||
@@ -154,6 +154,8 @@ public class PriceListVO extends TenantEntity {
|
||||
@Schema(description = "目标部门")
|
||||
private Long deptId;
|
||||
|
||||
private String tag;
|
||||
|
||||
private String categoryName;
|
||||
|
||||
private String categoryType;
|
||||
|
||||
@@ -198,6 +198,9 @@ public class KioskServiceImpl implements IKioskApiService {
|
||||
if (priceList == null) {
|
||||
throw new ServiceException("Invalid price.");
|
||||
}
|
||||
detailAmount = detailAmount.add(priceList.getActualPrice());
|
||||
orderDetail.setQuantity(item.getQuantity());
|
||||
orderDetail.setTag(priceList.getTag());
|
||||
|
||||
CategoryEntity category = categoryService.getById(priceList.getCategoryId());
|
||||
if (category == null) {
|
||||
@@ -275,8 +278,8 @@ public class KioskServiceImpl implements IKioskApiService {
|
||||
}
|
||||
orderDetail.setSnapshotLink(snapshotPhoto.getLink());
|
||||
|
||||
|
||||
orderDetail.setTotalAmount(detailAmount.add(priceList.getActualPrice()));
|
||||
orderDetail.setQuantity(item.getQuantity());
|
||||
orderDetail.setTotalAmount(detailAmount.multiply(BigDecimal.valueOf(item.getQuantity())));
|
||||
orderDetailService.save(orderDetail);
|
||||
totalAmount = totalAmount.add(orderDetail.getTotalAmount());
|
||||
|
||||
@@ -395,6 +398,7 @@ public class KioskServiceImpl implements IKioskApiService {
|
||||
vo.setMaterialUpgradePrice(p.getMaterialUpgradePrice());
|
||||
vo.setStand(p.getStand() == 1 ? Boolean.TRUE : Boolean.FALSE);
|
||||
vo.setStandPrice(p.getStandPrice());
|
||||
vo.setTag(p.getTag());
|
||||
return vo;
|
||||
}).toList();
|
||||
}
|
||||
@@ -425,8 +429,13 @@ public class KioskServiceImpl implements IKioskApiService {
|
||||
if (StringUtil.isNotBlank(request.getEmail()) && StringUtil.isNotBlank(order.getUserEmail())) {
|
||||
throw new ServiceException("Email already exists.");
|
||||
}
|
||||
order.setUserEmail(request.getEmail());
|
||||
order.setUserPhone(request.getPhone());
|
||||
boolean match = RegexUtil.match(request.getEmail(), RegexUtil.EMAIL);
|
||||
if (match) {
|
||||
order.setUserEmail(request.getEmail());
|
||||
} else {
|
||||
order.setUserPhone(request.getPhone());
|
||||
}
|
||||
|
||||
// if (StringUtil.isNotBlank(request.getEmail())) {
|
||||
// emailService.sendHtmlEmail(request.getEmail(), order.getSerialNumber());
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user