From b580430ec8bc38738c70f0c6287f3294b65a66cc Mon Sep 17 00:00:00 2001
From: xiaowang <2161656029@qq.com>
Date: Wed, 1 Jul 2026 13:34:37 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=91=98=E5=B7=A5=E9=A2=9C?=
=?UTF-8?q?=E8=89=B2=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/artist/dto/NailArtistInfoDTO.java | 5 +
.../artist/entity/NailArtistInfoDO.java | 5 +
.../service/impl/PlanningServiceImpl.java | 9 +-
JY-Salon-Front/src/views/ColorSettingView.vue | 199 ++++++++++++++++--
.../migrations/员工预约颜色字段_20260701.sql | 29 +++
5 files changed, 228 insertions(+), 19 deletions(-)
create mode 100644 scripts/sql/migrations/员工预约颜色字段_20260701.sql
diff --git a/JY-Core/src/main/java/com/xiaowang/jayucloud/core/modules/artist/dto/NailArtistInfoDTO.java b/JY-Core/src/main/java/com/xiaowang/jayucloud/core/modules/artist/dto/NailArtistInfoDTO.java
index 22223995..cce66ebe 100644
--- a/JY-Core/src/main/java/com/xiaowang/jayucloud/core/modules/artist/dto/NailArtistInfoDTO.java
+++ b/JY-Core/src/main/java/com/xiaowang/jayucloud/core/modules/artist/dto/NailArtistInfoDTO.java
@@ -49,6 +49,11 @@ public class NailArtistInfoDTO {
*/
private Integer status;
+ /**
+ * 预约展示颜色
+ */
+ private String color;
+
/**
* Field `participateProduction` (Integer): data variable carried by this DTO/VO/entity. Check controller/service usage to see when it is filled.
*/
diff --git a/JY-Core/src/main/java/com/xiaowang/jayucloud/core/modules/artist/entity/NailArtistInfoDO.java b/JY-Core/src/main/java/com/xiaowang/jayucloud/core/modules/artist/entity/NailArtistInfoDO.java
index 70f5639e..f84b512b 100644
--- a/JY-Core/src/main/java/com/xiaowang/jayucloud/core/modules/artist/entity/NailArtistInfoDO.java
+++ b/JY-Core/src/main/java/com/xiaowang/jayucloud/core/modules/artist/entity/NailArtistInfoDO.java
@@ -47,6 +47,11 @@ public class NailArtistInfoDO extends BaseEntity {
*/
private Integer status;
+ /**
+ * 预约展示颜色
+ */
+ private String color;
+
@TableField("participate_production")
/**
* Field `participateProduction` (Integer): data variable carried by this DTO/VO/entity. Check controller/service usage to see when it is filled.
diff --git a/JY-Core/src/main/java/com/xiaowang/jayucloud/core/modules/planning/service/impl/PlanningServiceImpl.java b/JY-Core/src/main/java/com/xiaowang/jayucloud/core/modules/planning/service/impl/PlanningServiceImpl.java
index ab74c47d..e98ade79 100644
--- a/JY-Core/src/main/java/com/xiaowang/jayucloud/core/modules/planning/service/impl/PlanningServiceImpl.java
+++ b/JY-Core/src/main/java/com/xiaowang/jayucloud/core/modules/planning/service/impl/PlanningServiceImpl.java
@@ -314,7 +314,7 @@ public class PlanningServiceImpl implements PlanningService {
vo.setShortName(PlanningCalendarSupport.shortName(vo.getName()));
vo.setPhone(firstNonBlank(user.getContactPhone(), user.getPhone(), ""));
vo.setAvatar(user.getAvatar());
- vo.setColor(colorForArtist(user.getId(), i));
+ vo.setColor(resolveArtistColor(info, user.getId(), i));
vo.setStatus(info == null || info.getStatus() == null ? user.getStatus() : info.getStatus());
vo.setStatusText(Integer.valueOf(0).equals(vo.getStatus()) ? "休息" : "可预约");
vo.setWorkStartTime(info == null || info.getWorkStartTime() == null ? null : info.getWorkStartTime().toString());
@@ -846,6 +846,13 @@ public class PlanningServiceImpl implements PlanningService {
.collect(Collectors.toMap(UserDO::getId, Function.identity(), (a, b) -> a));
}
+ private String resolveArtistColor(NailArtistInfoDO info, Long artistId, int index) {
+ if (info != null && hasText(info.getColor()) && info.getColor().trim().matches("^#[0-9a-fA-F]{6}$")) {
+ return info.getColor().trim().toUpperCase();
+ }
+ return colorForArtist(artistId, index);
+ }
+
private String colorForArtist(Long artistId, int index) {
if (artistId == null) {
return ARTIST_COLORS.get(index % ARTIST_COLORS.size());
diff --git a/JY-Salon-Front/src/views/ColorSettingView.vue b/JY-Salon-Front/src/views/ColorSettingView.vue
index 26b5cea9..7cdd256f 100644
--- a/JY-Salon-Front/src/views/ColorSettingView.vue
+++ b/JY-Salon-Front/src/views/ColorSettingView.vue
@@ -1,47 +1,172 @@
-
-
+
+
+
+
+
+
{{ employeeName }}
+
{{ selected }}
+
+
+
+
+
+
+
+
+
+
-
-
-
diff --git a/scripts/sql/migrations/员工预约颜色字段_20260701.sql b/scripts/sql/migrations/员工预约颜色字段_20260701.sql
new file mode 100644
index 00000000..1e449f87
--- /dev/null
+++ b/scripts/sql/migrations/员工预约颜色字段_20260701.sql
@@ -0,0 +1,29 @@
+CREATE DATABASE IF NOT EXISTS jayu_cloud DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
+use jayu_cloud;
+
+DROP PROCEDURE IF EXISTS sp_jy_add_column_if_not_exists;
+DELIMITER $$
+CREATE PROCEDURE sp_jy_add_column_if_not_exists(
+ IN p_table_name varchar(128),
+ IN p_column_name varchar(128),
+ IN p_column_sql varchar(1000)
+)
+BEGIN
+ IF NOT EXISTS (
+ SELECT 1
+ FROM information_schema.columns
+ WHERE table_schema = DATABASE()
+ AND table_name = p_table_name
+ AND column_name = p_column_name
+ ) THEN
+ SET @jy_sql = CONCAT('ALTER TABLE ', p_table_name, ' ADD COLUMN ', p_column_sql);
+ PREPARE jy_stmt FROM @jy_sql;
+ EXECUTE jy_stmt;
+ DEALLOCATE PREPARE jy_stmt;
+ END IF;
+END$$
+DELIMITER ;
+
+CALL sp_jy_add_column_if_not_exists('t_nail_artist_info', 'color', '`color` varchar(20) NULL COMMENT ''员工预约展示颜色''');
+
+DROP PROCEDURE IF EXISTS sp_jy_add_column_if_not_exists;