feat:职代会ui优化
This commit is contained in:
+27
-3
@@ -111,6 +111,13 @@ public class CongressH5ServiceImpl implements CongressH5Service {
|
||||
cm.file_type AS fileType,
|
||||
cm.file_size AS fileSize,
|
||||
cm.create_time AS uploadTime,
|
||||
CASE
|
||||
WHEN cvi.id IS NULL THEN NULL
|
||||
WHEN cvr.id IS NOT NULL THEN 'voted'
|
||||
WHEN cvi.voting_start_time IS NOT NULL AND cvi.voting_start_time > NOW() THEN 'upcoming'
|
||||
WHEN cvi.voting_end_time IS NOT NULL AND cvi.voting_end_time < NOW() THEN 'ended'
|
||||
ELSE 'pending'
|
||||
END AS voteStatus,
|
||||
CASE
|
||||
WHEN cvi.id IS NULL THEN NULL
|
||||
WHEN cvr.id IS NOT NULL THEN true
|
||||
@@ -132,8 +139,7 @@ public class CongressH5ServiceImpl implements CongressH5Service {
|
||||
WHERE COALESCE(cm.deleted, 0) = 0
|
||||
AND cm.type_id = @typeId
|
||||
AND (cm.session_id = @sessionId OR cm.time_id = @sessionId)
|
||||
AND (@searchKeyword = '' OR cm.name LIKE CONCAT('%%', @searchKeyword, '%%')
|
||||
OR cm.file_name LIKE CONCAT('%%', @searchKeyword, '%%'))
|
||||
AND (@searchKeyword = '' OR cm.name LIKE CONCAT('%%', @searchKeyword, '%%'))
|
||||
AND (@fileType = '' OR FIND_IN_SET(LOWER(REPLACE(cm.file_type, '.', '')), @fileType) > 0
|
||||
OR FIND_IN_SET(LOWER(SUBSTRING_INDEX(cm.file_name, '.', -1)), @fileType) > 0)
|
||||
ORDER BY cm.create_time %s, cm.id DESC
|
||||
@@ -349,6 +355,11 @@ public class CongressH5ServiceImpl implements CongressH5Service {
|
||||
i.voting_type AS votingType,
|
||||
i.voting_start_time AS votingStartTime,
|
||||
i.voting_end_time AS votingEndTime,
|
||||
CASE
|
||||
WHEN i.voting_start_time IS NOT NULL AND i.voting_start_time > NOW() THEN 'upcoming'
|
||||
WHEN i.voting_end_time IS NOT NULL AND i.voting_end_time < NOW() THEN 'ended'
|
||||
ELSE 'ongoing'
|
||||
END AS votingStatus,
|
||||
i.voting_content AS votingContent,
|
||||
i.voting_content_item_header AS votingContentItemHeader,
|
||||
i.voting_content_option_header AS votingContentOptionHeader,
|
||||
@@ -385,7 +396,14 @@ public class CongressH5ServiceImpl implements CongressH5Service {
|
||||
return Result.error("投票参数不完整");
|
||||
}
|
||||
NutMap issue = fetchMap("""
|
||||
SELECT id, session_id AS sessionId, COALESCE(time_id, session_id) AS timeId
|
||||
SELECT id,
|
||||
session_id AS sessionId,
|
||||
COALESCE(time_id, session_id) AS timeId,
|
||||
CASE
|
||||
WHEN voting_start_time IS NOT NULL AND voting_start_time > NOW() THEN 'upcoming'
|
||||
WHEN voting_end_time IS NOT NULL AND voting_end_time < NOW() THEN 'ended'
|
||||
ELSE 'ongoing'
|
||||
END AS votingStatus
|
||||
FROM congress_voting_issue
|
||||
WHERE id = @issueId
|
||||
AND session_id = @sessionId
|
||||
@@ -395,6 +413,12 @@ public class CongressH5ServiceImpl implements CongressH5Service {
|
||||
if (issue == null) {
|
||||
return Result.error("投票议题不存在");
|
||||
}
|
||||
if ("upcoming".equals(issue.getString("votingStatus"))) {
|
||||
return Result.error("投票尚未开始");
|
||||
}
|
||||
if ("ended".equals(issue.getString("votingStatus"))) {
|
||||
return Result.error("投票已结束,无法继续投票");
|
||||
}
|
||||
|
||||
NutMap rep = fetchMap("""
|
||||
SELECT id, userId, loginName, userName, delegationId
|
||||
|
||||
Reference in New Issue
Block a user