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

@@ -43,6 +43,7 @@ CREATE TABLE `kiosk_price_list`
`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 '创建部门',
@@ -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 '创建部门',

View File

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

View File

@@ -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;
/**
* 总金额
*/

View File

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

View File

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

View File

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

View File

@@ -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.");
}
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());
// }