Browse Source

10月31日提交 完整代码

xiang 3 weeks ago
parent
commit
f47733c3cb
64 changed files with 1314 additions and 318 deletions
  1. 4 2
      vctgo-api/vctgo-api-system/src/main/java/com/vctgo/system/api/domain/VoteSubmission.java
  2. 3 2
      vctgo-common/vctgo-common-core/src/main/java/com/vctgo/common/core/utils/poi/ExcelUtil.java
  3. 18 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/config/JacksonConfig.java
  4. 4 5
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteAppraiseController.java
  5. 0 2
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteDataStatisController.java
  6. 7 1
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteEventNewsCarouselsController.java
  7. 0 1
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteEventWorkSettingsController.java
  8. 2 4
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteEventsController.java
  9. 32 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteHistoryScoreController.java
  10. 1 1
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteJudgesVisibleFieldsController.java
  11. 25 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteLocationController.java
  12. 7 3
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteOrganizersController.java
  13. 13 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteSubmissionController.java
  14. 3 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteEvaluationTasks.java
  15. 3 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteEventNews.java
  16. 2 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteEventNewsCarousels.java
  17. 5 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteEventRegistrationWorkScores.java
  18. 9 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteEventWorkSettings.java
  19. 99 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteHistoryScore.java
  20. 0 2
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteJudgesVisibleFields.java
  21. 7 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteOrganizers.java
  22. 2 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteScoringItem.java
  23. 2 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteSubmission.java
  24. 7 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteSubmissionItem.java
  25. 20 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/pojo/VoteLocationVo.java
  26. 3 1
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/vo/VoteEventWorkSettingsVo.java
  27. 20 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/vo/VoteHistoryScoreVo.java
  28. 18 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/mapper/VoteHistoryScoreMapper.java
  29. 3 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/mapper/VoteOrganizersMapper.java
  30. 2 2
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/mapper/VoteSubmissionItemMapper.java
  31. 4 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/mapper/VoteSubmissionMapper.java
  32. 2 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteEventNewsCarouselsService.java
  33. 3 2
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteEventsService.java
  34. 18 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteHistoryScoreService.java
  35. 1 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteJudgesVisibleFieldsService.java
  36. 15 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteLocationService.java
  37. 2 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteOrganizersService.java
  38. 2 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteSubmissionService.java
  39. 33 16
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteAppraiseServiceImpl.java
  40. 24 12
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteDataStatisServiceImpl.java
  41. 167 80
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEvaluationTasksServiceImpl.java
  42. 87 10
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEventAppletServiceImpl.java
  43. 12 4
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEventCompetitionZonesServiceImpl.java
  44. 8 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEventNewsCarouselsServiceImpl.java
  45. 6 2
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEventNewsServiceImpl.java
  46. 61 8
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEventWorkSettingsServiceImpl.java
  47. 47 17
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEventsServiceImpl.java
  48. 42 11
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteExpertWorkingPlatformServiceImpl.java
  49. 46 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteHistoryScoreServiceImpl.java
  50. 15 2
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteJudgesVisibleFieldsServiceImpl.java
  51. 47 0
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteLocationServiceImpl.java
  52. 15 1
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteOrganizersServiceImpl.java
  53. 62 5
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteRegistrationsServiceImpl.java
  54. 3 2
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteRuleServiceImpl.java
  55. 11 7
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteScoringItemServiceImpl.java
  56. 1 1
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteSubmissionFormServiceImpl.java
  57. 199 91
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteSubmissionServiceImpl.java
  58. 5 2
      vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteWorkTypesServiceImpl.java
  59. 11 9
      vctgo-modules/vctgo-vote-system/src/main/resources/mapper/VoteEvaluationTasksMapper.xml
  60. 1 0
      vctgo-modules/vctgo-vote-system/src/main/resources/mapper/VoteEventNewsCarouselsMapper.xml
  61. 12 10
      vctgo-modules/vctgo-vote-system/src/main/resources/mapper/VoteEventRegistrationWorkScoresMapper.xml
  62. 20 0
      vctgo-modules/vctgo-vote-system/src/main/resources/mapper/VoteHistoryScoreMapper.xml
  63. 1 0
      vctgo-modules/vctgo-vote-system/src/main/resources/mapper/VoteSubmissionItemMapper.xml
  64. 10 0
      vctgo-modules/vctgo-vote-system/src/main/resources/mapper/VoteSubmissionMapper.xml

+ 4 - 2
vctgo-api/vctgo-api-system/src/main/java/com/vctgo/system/api/domain/VoteSubmission.java

@@ -50,8 +50,8 @@ public class VoteSubmission implements Serializable {
     private String commitName;
 
     /**
-//     * 园所主键
-//     */
+     //     * 园所主键
+     //     */
 //    private Long locationId;
 
     /**
@@ -67,6 +67,8 @@ public class VoteSubmission implements Serializable {
 
     private String ageSegment;//班龄段(0小班 1中班 2大班)
 
+    private String appraiseStatus;
+
 //    private String file;//作品文档
 //
 //    private String video;//作品视频

+ 3 - 2
vctgo-common/vctgo-common-core/src/main/java/com/vctgo/common/core/utils/poi/ExcelUtil.java

@@ -25,6 +25,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.InputStream;
@@ -1328,8 +1329,8 @@ public class ExcelUtil<T> {
         }
 
         // 将 workbook 写入响应流
-        try {
-            wb.write(response.getOutputStream());
+        try(ServletOutputStream outputStream = response.getOutputStream();) {
+            wb.write(outputStream);
         } catch (IOException e) {
             e.printStackTrace();
         } finally {

+ 18 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/config/JacksonConfig.java

@@ -0,0 +1,18 @@
+//package com.vote.system.config;
+//
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.Configuration;
+//import com.fasterxml.jackson.databind.ObjectMapper;
+//import com.fasterxml.jackson.core.JsonParser;
+//
+//@Configuration
+//public class JacksonConfig{
+//
+//    @Bean
+//    public ObjectMapper objectMapper() {
+//        ObjectMapper objectMapper = new ObjectMapper();
+//// 启用解析JSON注释的功能
+//        objectMapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
+//        return objectMapper;
+//    }
+//}

+ 4 - 5
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteAppraiseController.java

@@ -3,11 +3,13 @@ package com.vote.system.controller;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.vctgo.common.core.web.domain.AjaxResult;
 import com.vote.system.domain.dto.VoteEvaluationTasksDto;
-import com.vote.system.domain.vo.VoteEventRegistrationsVo;
 import com.vote.system.domain.vo.VoteSubmissionVo;
 import com.vote.system.service.VoteAppraiseService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
 
@@ -54,7 +56,4 @@ public class VoteAppraiseController {
     }
 
 
-
-
-
 }

+ 0 - 2
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteDataStatisController.java

@@ -1,11 +1,9 @@
 package com.vote.system.controller;
 
 import com.vctgo.common.core.web.domain.AjaxResult;
-import com.vote.system.domain.VoteRegistrations;
 import com.vote.system.domain.dto.VoteEvaluationTasksDto;
 import com.vote.system.service.VoteDataStatisService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;

+ 7 - 1
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteEventNewsCarouselsController.java

@@ -37,7 +37,13 @@ public class VoteEventNewsCarouselsController {
 
     @DeleteMapping("/{id}")
     public AjaxResult deleteById(@PathVariable("id") Long id) {
-        return AjaxResult.success(voteEventNewsCarouselsService.removeById(id));
+        int i = voteEventNewsCarouselsService.deleteById(id);
+        if (i > 0) {
+            return AjaxResult.success(i);
+        } else {
+            return AjaxResult.error("删除失败");
+        }
+
     }
 
 

+ 0 - 1
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteEventWorkSettingsController.java

@@ -53,7 +53,6 @@ public class VoteEventWorkSettingsController {
     public AjaxResult getJudges() {
         Map<String, String> map = voteEventWorkSettingsService.getJudges();
         return AjaxResult.success(map);
-
     }
 
 

+ 2 - 4
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteEventsController.java

@@ -63,13 +63,11 @@ public class VoteEventsController {
     /**
      * 修改
      *
-     * @param id
-     * @param status
      * @return
      */
     @PutMapping("/editStatus")
-    public AjaxResult editEvents(@RequestParam("id") Long id, @RequestParam("status") String status) {
-        boolean result = voteEventsService.changeStatus(id, status);
+    public AjaxResult editStatus(@RequestBody VoteEvents voteEvents) {
+        boolean result = voteEventsService.changeStatus(voteEvents);
         if (result) {
             return AjaxResult.success("修改成功");
         } else {

+ 32 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteHistoryScoreController.java

@@ -0,0 +1,32 @@
+package com.vote.system.controller;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.vctgo.common.core.web.domain.AjaxResult;
+import com.vote.system.domain.VoteHistoryScore;
+import com.vote.system.service.VoteHistoryScoreService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @CreateTime: 2024/9/29 下午6:36
+ * @Description:
+ * @Email: f2965573933@163.com
+ * @Author: FanJiaBao
+ */
+@RestController
+@RequestMapping("/history")
+public class VoteHistoryScoreController {
+
+
+    @Autowired
+    private VoteHistoryScoreService voteHistoryScoreService;
+
+    @GetMapping("/{submissionId}")
+    public AjaxResult getHistoryScoreBySubmissionId(@PathVariable("submissionId") Long submissionId){
+        return AjaxResult.success(voteHistoryScoreService.getHistoryScore(submissionId));
+    }
+
+}

+ 1 - 1
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteJudgesVisibleFieldsController.java

@@ -28,7 +28,7 @@ public class VoteJudgesVisibleFieldsController {
 
     @PostMapping("/save")
     public AjaxResult save(@RequestBody VoteJudgesVisibleFields voteJudgesVisibleFields){
-        return AjaxResult.success(voteJudgesVisibleFieldsService.save(voteJudgesVisibleFields));
+        return AjaxResult.success(voteJudgesVisibleFieldsService.addVoteJudgesVisibleFields(voteJudgesVisibleFields));
     }
 
 

+ 25 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteLocationController.java

@@ -0,0 +1,25 @@
+package com.vote.system.controller;
+
+import com.vctgo.common.core.web.domain.AjaxResult;
+import com.vote.system.service.VoteLocationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@RestController
+@RequestMapping("/location")
+public class VoteLocationController {
+
+    @Autowired
+    private VoteLocationService voteLocationService;
+
+
+    @GetMapping("/{districtId}")
+    public AjaxResult getLocationName(@PathVariable("districtId") String districtId) {
+        return AjaxResult.success(voteLocationService.getLocationName(districtId));
+    }
+
+}

+ 7 - 3
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteOrganizersController.java

@@ -4,12 +4,16 @@ import com.vctgo.common.core.web.domain.AjaxResult;
 import com.vote.system.domain.VoteOrganizers;
 import com.vote.system.service.VoteOrganizersService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import javax.validation.Valid;
+
 /**
  * @author feng
  * @date 2024/8/11
  */
+@Validated
 @RestController
 @RequestMapping("/organizers")
 public class VoteOrganizersController {
@@ -35,7 +39,7 @@ public class VoteOrganizersController {
      * @return
      */
     @PostMapping
-    public AjaxResult addOrganizers(@RequestBody VoteOrganizers voteOrganizers) {
+    public AjaxResult addOrganizers(@RequestBody @Valid VoteOrganizers voteOrganizers) {
         return AjaxResult.success(organizersService.addOrganizers(voteOrganizers));
     }
 
@@ -46,8 +50,8 @@ public class VoteOrganizersController {
      * @return
      */
     @PutMapping("/edit")
-    public AjaxResult editOrganizers(@RequestBody VoteOrganizers voteOrganizers) {
-        return AjaxResult.success(organizersService.updateById(voteOrganizers));
+    public AjaxResult editOrganizers(@RequestBody @Valid VoteOrganizers voteOrganizers) {
+        return AjaxResult.success(organizersService.edit(voteOrganizers));
     }
 
     /**

+ 13 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/controller/VoteSubmissionController.java

@@ -97,6 +97,7 @@ public class VoteSubmissionController {
 
     /**
      * 修改
+     *
      * @param voteSubmissionDto
      * @return
      */
@@ -140,4 +141,16 @@ public class VoteSubmissionController {
     public AjaxResult distribute(@RequestBody VoteSubmissionDto voteSubmissionDto) {
         return AjaxResult.success(voteSubmissionService.distribute(voteSubmissionDto));
     }
+
+
+    /**
+     *  评奖晋级
+     * @param voteSubmissionDto
+     * @return
+     */
+    @PutMapping("/promoteAward")
+    public AjaxResult promoteAward(@RequestBody VoteSubmissionDto voteSubmissionDto) {
+        return AjaxResult.success(voteSubmissionService.promoteAward(voteSubmissionDto));
+    }
+
 }

+ 3 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteEvaluationTasks.java

@@ -30,6 +30,9 @@ public class VoteEvaluationTasks implements Serializable {
      */
     private Long submissionId;
 
+
+    private Long roundId;
+
     /**
      * 评审专家ID
      */

+ 3 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteEventNews.java

@@ -4,6 +4,7 @@ import java.io.Serializable;
 import java.util.Date;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.vote.system.domain.eunm.VoteEventType;
@@ -78,11 +79,13 @@ public class VoteEventNews implements Serializable {
     /**
      *
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date createdAt;
 
     /**
      *
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date updatedAt;
 
     @TableField(exist = false)

+ 2 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteEventNewsCarousels.java

@@ -53,6 +53,8 @@ public class VoteEventNewsCarousels implements Serializable {
      */
     private Date updatedAt;
 
+    private String isDelete;
+
     @TableField(exist = false)
     private String title;
 

+ 5 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteEventRegistrationWorkScores.java

@@ -29,13 +29,18 @@ public class VoteEventRegistrationWorkScores implements Serializable {
     /**
      * 
      */
+    @JsonSerialize(using = ToStringSerializer.class)
     private Long eventId;
 
     /**
      * 作品设置
      */
+    @JsonSerialize(using = ToStringSerializer.class)
     private Long workSettingsId;
 
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long roundId;
+
     /**
      * 
      */

+ 9 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteEventWorkSettings.java

@@ -8,6 +8,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import javax.validation.Valid;
 import javax.validation.constraints.NotNull;
@@ -97,6 +98,14 @@ public class VoteEventWorkSettings implements Serializable {
     private String workTypeName;
 
     @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date electSatTime;
+
+    @TableField(exist = false)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date electEndTime;
+
+    @TableField(exist = false)
     private List<VoteEventEvaluationRounds> voteEventEvaluationRounds;//评选轮次
 
     @TableField(exist = false)

+ 99 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteHistoryScore.java

@@ -0,0 +1,99 @@
+package com.vote.system.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.Data;
+
+/**
+ * @TableName vote_history_score
+ */
+@TableName(value = "vote_history_score")
+@Data
+public class VoteHistoryScore implements Serializable {
+    /**
+     * 主键
+     */
+    @TableId
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    private Long roundId;
+
+    /**
+     * 作品主键
+     */
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long submissionId;
+
+    /**
+     * 轮次
+     */
+    private String alternately;
+
+    /**
+     * 历史分数
+     */
+    private String score;
+
+    /**
+     * 结果
+     */
+    private String result;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        VoteHistoryScore other = (VoteHistoryScore) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+                && (this.getSubmissionId() == null ? other.getSubmissionId() == null : this.getSubmissionId().equals(other.getSubmissionId()))
+                && (this.getAlternately() == null ? other.getAlternately() == null : this.getAlternately().equals(other.getAlternately()))
+                && (this.getScore() == null ? other.getScore() == null : this.getScore().equals(other.getScore()))
+                && (this.getResult() == null ? other.getResult() == null : this.getResult().equals(other.getResult()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getSubmissionId() == null) ? 0 : getSubmissionId().hashCode());
+        result = prime * result + ((getAlternately() == null) ? 0 : getAlternately().hashCode());
+        result = prime * result + ((getScore() == null) ? 0 : getScore().hashCode());
+        result = prime * result + ((getResult() == null) ? 0 : getResult().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", submissionId=").append(submissionId);
+        sb.append(", alternately=").append(alternately);
+        sb.append(", score=").append(score);
+        sb.append(", result=").append(result);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 0 - 2
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteJudgesVisibleFields.java

@@ -32,12 +32,10 @@ public class VoteJudgesVisibleFields implements Serializable {
     private Long workSettingsId;
 
     private Long eventId;
-
     /**
      * 专家可见信息配置
      */
     private String visibleFields;
-
     /**
      * 创建时间
      */

+ 7 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteOrganizers.java

@@ -9,6 +9,10 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.Data;
 
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
 /**
  * 主办方
  * @TableName vote_organizers
@@ -25,6 +29,9 @@ public class VoteOrganizers implements Serializable {
     /**
      * 组织名称
      */
+    @Valid
+    @NotNull(message = "主办方名称不允许为空")
+    @Size(max = 255 , message = "主办方名称最大不可超过255")
     private String name;
 
     /**

+ 2 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteScoringItem.java

@@ -25,6 +25,8 @@ public class VoteScoringItem implements Serializable {
     @JsonSerialize(using = ToStringSerializer.class)
     private Long id;
 
+
+
     /**
      * 评分项
      */

+ 2 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteSubmission.java

@@ -112,6 +112,8 @@ public class VoteSubmission implements Serializable {
      * 租户id
      */
     private Long tenantId;
+    @TableField(exist = false)
+    private String belongRegion;
 
     @TableField(exist = false)
     private List<VoteFileVo> imageFiles;

+ 7 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/VoteSubmissionItem.java

@@ -6,6 +6,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import java.util.Date;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.Data;
 
 /**
@@ -24,8 +27,12 @@ public class VoteSubmissionItem implements Serializable {
     /**
      * 作品主键
      */
+    @JsonSerialize(using = ToStringSerializer.class)
     private Long submissionId;
 
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long roundId;
+
     /**
      * 规则项主键
      */

+ 20 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/pojo/VoteLocationVo.java

@@ -0,0 +1,20 @@
+package com.vote.system.domain.pojo;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.Data;
+
+/**
+ * @CreateTime: 2024/9/24 下午5:33
+ * @Description:
+ * @Email: f2965573933@163.com
+ * @Author: FanJiaBao
+ */
+@Data
+public class VoteLocationVo {
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    private String locationName;
+}

+ 3 - 1
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/vo/VoteEventWorkSettingsVo.java

@@ -19,10 +19,12 @@ import java.util.List;
 @Data
 public class VoteEventWorkSettingsVo {
 
-    private String  name;
+    private String name;
 
     @JsonSerialize(using = ToStringSerializer.class)
     private Long id;
 
+    private String status;
+
     private List<VoteEventWorkSettings> voteEventWorkSettingsList;//作品设置
 }

+ 20 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/domain/vo/VoteHistoryScoreVo.java

@@ -0,0 +1,20 @@
+package com.vote.system.domain.vo;
+
+import com.vote.system.domain.VoteHistoryScore;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @CreateTime: 2024/9/29 下午6:39
+ * @Description:
+ * @Email: f2965573933@163.com
+ * @Author: FanJiaBao
+ */
+@Data
+public class VoteHistoryScoreVo {
+
+    private String submissionName;
+
+    private List<VoteHistoryScore> voteHistoryScores;
+}

+ 18 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/mapper/VoteHistoryScoreMapper.java

@@ -0,0 +1,18 @@
+package com.vote.system.mapper;
+
+import com.vote.system.domain.VoteHistoryScore;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author Administrator
+* @description 针对表【vote_history_score】的数据库操作Mapper
+* @createDate 2024-09-29 18:03:15
+* @Entity com.vote.system.domain.VoteHistoryScore
+*/
+public interface VoteHistoryScoreMapper extends BaseMapper<VoteHistoryScore> {
+
+}
+
+
+
+

+ 3 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/mapper/VoteOrganizersMapper.java

@@ -2,6 +2,7 @@ package com.vote.system.mapper;
 
 import com.vote.system.domain.VoteOrganizers;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Select;
 
 /**
 * @author MacBook
@@ -11,6 +12,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 */
 public interface VoteOrganizersMapper extends BaseMapper<VoteOrganizers> {
 
+    @Select("SELECT COUNT(*) > 0 FROM vote_organizers WHERE name = #{name}")
+    boolean existsByName(String name);
 }
 
 

+ 2 - 2
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/mapper/VoteSubmissionItemMapper.java

@@ -23,9 +23,9 @@ public interface VoteSubmissionItemMapper extends BaseMapper<VoteSubmissionItem>
      */
     @Insert({
             "<script>",
-            "INSERT INTO vote_submission_item (submission_id, item_id, score) VALUES ",
+            "INSERT INTO vote_submission_item (submission_id, item_id, score,round_id) VALUES ",
             "<foreach collection='itemList' item='itemList' separator=','>",
-            "(#{itemList.submissionId}, #{itemList.itemId}, #{itemList.score})",
+            "(#{itemList.submissionId}, #{itemList.itemId}, #{itemList.score},#{itemList.roundId})",
             "</foreach>",
             "</script>"
     })

+ 4 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/mapper/VoteSubmissionMapper.java

@@ -2,6 +2,9 @@ package com.vote.system.mapper;
 
 import com.vote.system.domain.VoteSubmission;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
 * @author MacBook
@@ -11,6 +14,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 */
 public interface VoteSubmissionMapper extends BaseMapper<VoteSubmission> {
 
+    void updateBatch(@Param("submissionIds") List<Long> submissionIds);
 }
 
 

+ 2 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteEventNewsCarouselsService.java

@@ -15,4 +15,6 @@ public interface VoteEventNewsCarouselsService extends IService<VoteEventNewsCar
     List<VoteEventNewsCarousels> chartList(VoteEventNewsCarousels voteEventNewsCarousels);
 
     int saveCarousels(VoteEventNewsCarousels voteEventNewsCarousels);
+
+    int deleteById(Long id);
 }

+ 3 - 2
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteEventsService.java

@@ -2,6 +2,7 @@ package com.vote.system.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.vctgo.common.core.web.domain.AjaxResult;
 import com.vote.system.domain.VoteEvents;
 import com.vote.system.domain.vo.VoteEventsVo;
 
@@ -20,7 +21,7 @@ public interface VoteEventsService extends IService<VoteEvents> {
 
     int deleteEvents(Long id);
 
-    boolean changeStatus(Long id, String status);
+    boolean changeStatus(VoteEvents voteEvents);
 
-    int edit(VoteEvents voteEvents);
+    AjaxResult edit(VoteEvents voteEvents);
 }

+ 18 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteHistoryScoreService.java

@@ -0,0 +1,18 @@
+package com.vote.system.service;
+
+import com.vote.system.domain.VoteHistoryScore;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.vote.system.domain.vo.VoteHistoryScoreVo;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 针对表【vote_history_score】的数据库操作Service
+* @createDate 2024-09-29 18:03:15
+*/
+public interface VoteHistoryScoreService extends IService<VoteHistoryScore> {
+
+
+    VoteHistoryScoreVo getHistoryScore(Long submissionId);
+}

+ 1 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteJudgesVisibleFieldsService.java

@@ -15,4 +15,5 @@ public interface VoteJudgesVisibleFieldsService extends IService<VoteJudgesVisib
 
     List<Map<String, String>> selectByWorkSettingsId(Long workSettingsId);
 
+    int addVoteJudgesVisibleFields(VoteJudgesVisibleFields voteJudgesVisibleFields);
 }

+ 15 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteLocationService.java

@@ -0,0 +1,15 @@
+package com.vote.system.service;
+
+import com.vote.system.domain.pojo.VoteLocationVo;
+
+import java.util.List;
+
+/**
+ * @CreateTime: 2024/9/24 下午5:29
+ * @Description:
+ * @Email: f2965573933@163.com
+ * @Author: FanJiaBao
+ */
+public interface VoteLocationService {
+    List<VoteLocationVo> getLocationName(String districtId);
+}

+ 2 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteOrganizersService.java

@@ -16,4 +16,6 @@ public interface VoteOrganizersService extends IService<VoteOrganizers> {
     List<VoteOrganizers> getOrganizers();
 
     int addOrganizers(VoteOrganizers voteOrganizers);
+
+    int edit(VoteOrganizers voteOrganizers);
 }

+ 2 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/VoteSubmissionService.java

@@ -39,4 +39,6 @@ public interface VoteSubmissionService extends IService<VoteSubmission> {
     VoteSubmissionItemVo getSubmissionItem(VoteSubmissionDto voteSubmissionDto);
 
     int editItem(VoteSubmissionItemDto voteSubmissionDto);
+
+    int promoteAward(VoteSubmissionDto voteSubmissionDto);
 }

+ 33 - 16
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteAppraiseServiceImpl.java

@@ -26,6 +26,9 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
+import static com.vote.system.util.ConstantUtils.IS_DELETED_0;
+import static com.vote.system.util.ConstantUtils.PROMOTE_0;
+
 /**
  * @author feng
  * @date 2024/8/26
@@ -68,17 +71,31 @@ public class VoteAppraiseServiceImpl implements VoteAppraiseService {
     @Override
     public VoteAppraiseVo getVoteAppraiseByEventId(Long eventId) {
         VoteAppraiseVo vo = new VoteAppraiseVo();
+
+        // 增加对voteEvents是否为null的检查
         VoteEvents voteEvents = voteEventsMapper.selectById(eventId);
-        vo.setEventsName(voteEvents.getName());
-        //获取类型
+        if (voteEvents != null) {
+            vo.setEventsName(voteEvents.getName());
+        } else {
+            // 返回一个空的vo对象
+            return vo;
+        }
+
+        // 获取类型
         List<VoteEventWorkSettings> settings = getWorkSettings(eventId);
         if (!settings.isEmpty()) {
             List<VoteWorkTypeVo> workTypeVos = settings.stream()
-                    .map(setting -> createWorkTypeVo(setting, eventId))
+                    .map(setting -> {
+                        try {
+                            return createWorkTypeVo(setting, eventId);
+                        } catch (Exception e) {
+                            return null; // 返回null,忽略该条记录
+                        }
+                    })
+                    .filter(Objects::nonNull) // 过滤掉null值
                     .collect(Collectors.toList());
             vo.setWorkTypes(workTypeVos);
         }
-
         return vo;
     }
 
@@ -190,12 +207,12 @@ public class VoteAppraiseServiceImpl implements VoteAppraiseService {
         String[] judges = evaluationRounds.getJudges().split(",");
         roundVo.setJudgedCount(judges.length);//专家数
 
-        roundVo.setZonesCount(getZonesCount(eventId, setting.getId()));//赛区数
+        roundVo.setZonesCount(getZonesCount(eventId, setting.getId(), roundId));//赛区数
         List<VoteSubmission> voteSubmissions = getVoteSubmissions(eventId, setting.getId(), evaluationRounds.getId());
         roundVo.setParticipateCount(voteSubmissions.size());//作品数
 
-        roundVo.setDoneJudgedCount(calculateTaskCount(voteSubmissions, judges, true));
-        roundVo.setDoneSubmissionCount(calculateTaskCount(voteSubmissions, judges, false));
+        roundVo.setDoneJudgedCount(calculateTaskCount(voteSubmissions, judges, true, roundId));
+        roundVo.setDoneSubmissionCount(calculateTaskCount(voteSubmissions, judges, false, roundId));
 
         return roundVo;
     }
@@ -204,16 +221,18 @@ public class VoteAppraiseServiceImpl implements VoteAppraiseService {
         LambdaQueryWrapper<VoteSubmission> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(VoteSubmission::getRoundId, roundId)
                 .eq(VoteSubmission::getEventId, eventId)
-                .eq(VoteSubmission::getWorkSettingsId, setting)
-                .ne(VoteSubmission::getAward, 0);
+                .eq(VoteSubmission::getWorkSettingsId, setting.getId())
+                .ne(VoteSubmission::getAward, "0");
         return voteSubmissionMapper.selectList(wrapper).size();
     }
 
     //赛区数
-    private Long getZonesCount(Long eventId, Long workSettingsId) {
+    private Long getZonesCount(Long eventId, Long workSettingsId, String roundId) {
         LambdaQueryWrapper<VoteEventCompetitionZones> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(VoteEventCompetitionZones::getEventId, eventId)
-                .eq(VoteEventCompetitionZones::getWorkSettingsId, workSettingsId);
+                .eq(VoteEventCompetitionZones::getWorkSettingsId, workSettingsId)
+                .eq(VoteEventCompetitionZones::getRoundId, roundId)
+                .eq(VoteEventCompetitionZones::getIsDeleted, IS_DELETED_0);
         return voteEventCompetitionZonesMapper.selectCount(queryWrapper);
     }
 
@@ -227,22 +246,20 @@ public class VoteAppraiseServiceImpl implements VoteAppraiseService {
     }
 
     //已完成任务数 和 评选完成作品数 通过 includeJudgeCondition 参数控制
-    private int calculateTaskCount(List<VoteSubmission> voteSubmissions, String[] judges, boolean includeJudgeCondition) {
+    private int calculateTaskCount(List<VoteSubmission> voteSubmissions, String[] judges, boolean includeJudgeCondition, String roundId) {
         AtomicInteger taskCount = new AtomicInteger(0);
         List<String> judgesIds = Arrays.asList(judges);
         for (VoteSubmission submission : voteSubmissions) {
             LambdaQueryWrapper<VoteEvaluationTasks> taskQueryWrapper = new LambdaQueryWrapper<>();
             taskQueryWrapper.eq(VoteEvaluationTasks::getSubmissionId, submission.getId())
-                    .eq(VoteEvaluationTasks::getStatus, 1); // 状态为1
-
+                    .eq(VoteEvaluationTasks::getStatus, 1)   // 状态为1
+                    .eq(VoteEvaluationTasks::getRoundId, roundId);
             if (includeJudgeCondition) {
                 taskQueryWrapper.in(VoteEvaluationTasks::getJudgeId, judgesIds);
             }
-
             Long count = voteEvaluationTasksMapper.selectCount(taskQueryWrapper);
             taskCount.addAndGet(Math.toIntExact(count));
         }
-
         return taskCount.get();
     }
 

+ 24 - 12
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteDataStatisServiceImpl.java

@@ -316,12 +316,17 @@ public class VoteDataStatisServiceImpl implements VoteDataStatisService {
         Map<String, List<VoteSubmission>> submissionsByProvince = new HashMap<>();
         Map<Long, String> userIdToProvince = registrations.stream()
                 .collect(Collectors.toMap(VoteRegistrations::getUid, VoteRegistrations::getProvinceId));
+
+        Map<Long, String> userName = registrations.stream()
+                .collect(Collectors.toMap(VoteRegistrations::getUid, VoteRegistrations::getName));
+
         for (VoteSubmission submission : voteSubmissions) {
             String provinceId = userIdToProvince.get(submission.getUserId());
             if (provinceId != null) {
                 submissionsByProvince.computeIfAbsent(provinceId, k -> new ArrayList<>()).add(submission);
             }
         }
+
         // 4. 获取省份名称
         Map<String, String> provinceMap = getStringStringMap();
         // 6. 遍历分组数据,为每个省份创建一个 Sheet
@@ -334,7 +339,7 @@ public class VoteDataStatisServiceImpl implements VoteDataStatisService {
                         VoteSubmissionExport export = new VoteSubmissionExport();
                         export.setName(submission.getName());
                         export.setAils(aliasMap.getOrDefault(submission.getWorkSettingsId(), "未知类型"));
-                        export.setCommitName(submission.getCommitName());
+                        export.setCommitName(userName.get(submission.getUserId()));
                         LambdaQueryWrapper<VoteRegistrations> lambdaQueryWrapper = new LambdaQueryWrapper<>();
                         lambdaQueryWrapper.eq(VoteRegistrations::getEventId, eventId).eq(VoteRegistrations::getUid, submission.getUserId());
                         VoteRegistrations voteRegistrations = voteRegistrationsMapper.selectOne(lambdaQueryWrapper);
@@ -503,7 +508,8 @@ public class VoteDataStatisServiceImpl implements VoteDataStatisService {
         queryWrapper.in(VoteRegistrations::getProvinceId, provinceIds)
                 .eq(VoteRegistrations::getEventId, voteEvaluationTasksDto.getEventId());
         List<VoteRegistrations> registrations = voteRegistrationsMapper.selectList(queryWrapper);
-
+        Map<Long, String> userName = registrations.stream()
+                .collect(Collectors.toMap(VoteRegistrations::getUid, VoteRegistrations::getName));
         // 5. 根据报名用户查询作品
         List<Long> userIds = registrations.stream()
                 .map(VoteRegistrations::getUid)
@@ -515,12 +521,15 @@ public class VoteDataStatisServiceImpl implements VoteDataStatisService {
                 .eq(VoteSubmission::getRoundId, voteEvaluationTasksDto.getRoundId())
                 .eq(VoteSubmission::getPromoteStatus, "0"); // 只查询已晋级的作品
         List<VoteSubmission> submissions = voteSubmissionMapper.selectList(submissionWrapper);
+        if (submissions.isEmpty()) {
+            return;
+        }
         // 6. 封装导出数据
         List<VoteZonesExport> exportData = submissions.stream()
                 .map(sub -> {
                     VoteZonesExport zonesExport = new VoteZonesExport();
                     zonesExport.setSubmissionName(sub.getName())
-                            .setCommitName(sub.getCommitName());
+                            .setCommitName(userName.get(sub.getUserId()));
                     // 查询报名信息
                     LambdaQueryWrapper<VoteRegistrations> regWrapper = new LambdaQueryWrapper<>();
                     regWrapper.eq(VoteRegistrations::getEventId, voteEvaluationTasksDto.getEventId())
@@ -553,7 +562,7 @@ public class VoteDataStatisServiceImpl implements VoteDataStatisService {
                         .map(VoteEventCompetitionZones::getName)
                         .orElse("未知赛区")));
         // 6. 设置表头和数据提取函数
-        List<String> headers = Arrays.asList("作品名", "省市", "幼儿园", "提交人", "总分");
+        List<String> headers = new ArrayList<>(Arrays.asList("作品名", "省市", "幼儿园", "提交人", "总分"));
         if ("award".equals(rounds.getType())) {
             headers.add("奖项");
         }
@@ -580,7 +589,7 @@ public class VoteDataStatisServiceImpl implements VoteDataStatisService {
         List<VoteEventWorkSettings> workSettings = voteEventWorkSettingsMapper.selectList(
                 new LambdaQueryWrapper<VoteEventWorkSettings>().eq(VoteEventWorkSettings::getEventId, eventId)
         );
-        if (workSettings.size() == 0) {
+        if (workSettings.isEmpty()) {
             return categoryVos;
         }
         // 提前查询出所有评选轮次,避免多次 `selectById` 调用
@@ -596,6 +605,9 @@ public class VoteDataStatisServiceImpl implements VoteDataStatisService {
         wrapper.eq(VoteSubmission::getEventId, eventId)
                 .in(VoteSubmission::getRoundId, allRoundIds);
         List<VoteSubmission> voteSubmissions = voteSubmissionMapper.selectList(wrapper);
+        if (voteSubmissions.isEmpty()) {
+            return categoryVos;
+        }
         // 批量查询轮次数据
         List<VoteEventEvaluationRounds> evaluationRoundsList = voteEventEvaluationRoundsMapper.selectBatchIds(allRoundIds);
         // 对每个工作设置进行处理
@@ -620,8 +632,8 @@ public class VoteDataStatisServiceImpl implements VoteDataStatisService {
                     // 轮次任务进度
                     String[] judges = evaluationRounds.getJudges().split(",");
                     List<String> judgesIds = Arrays.asList(judges);
-                    Integer total = getJudgesTaskTotal(judgesIds, false, voteSubmissions); // 总任务数
-                    Integer completed = getJudgesTaskTotal(judgesIds, true, voteSubmissions); // 完成任务数
+                    Integer total = getJudgesTaskTotal(judgesIds, false, voteSubmissions, roundId); // 总任务数
+                    Integer completed = getJudgesTaskTotal(judgesIds, true, voteSubmissions, roundId); // 完成任务数
                     roundVo.setTotalProgress(String.valueOf(total));
                     roundVo.setOkProgress(String.valueOf(completed));
                     Integer countOfAdvancedSubmissions = getCountOfAdvancedSubmissions(judgesIds, voteSubmissions);
@@ -633,7 +645,7 @@ public class VoteDataStatisServiceImpl implements VoteDataStatisService {
                         roundVo.setReviewed(Optional.of(promote).orElse(0));
                     }
                     // 专家评分进度
-                    List<VoteJudgeProgressVo> judgeProgressVos = getJudgeProgressList(judgesIds, experts, voteSubmissions);
+                    List<VoteJudgeProgressVo> judgeProgressVos = getJudgeProgressList(judgesIds, experts, voteSubmissions, roundId);
                     roundVo.setJudgeProgressVos(judgeProgressVos);
 
                     // 将当前轮次信息添加到类别的轮次列表中
@@ -651,12 +663,12 @@ public class VoteDataStatisServiceImpl implements VoteDataStatisService {
     /**
      * 获取专家评分进度
      */
-    private List<VoteJudgeProgressVo> getJudgeProgressList(List<String> judgeIds, List<SysPlatformUser> experts, List<VoteSubmission> voteSubmissions) {
+    private List<VoteJudgeProgressVo> getJudgeProgressList(List<String> judgeIds, List<SysPlatformUser> experts, List<VoteSubmission> voteSubmissions, Long roundId) {
         List<VoteJudgeProgressVo> judgeProgressVos = new ArrayList<>();
         List<Long> submissionIds = voteSubmissions.stream().map(VoteSubmission::getId).collect(Collectors.toList());//该活动轮次下的作品
         // 批量查询所有专家的任务
         List<VoteEvaluationTasks> allTasks = voteEvaluationTasksMapper.selectList(
-                new LambdaQueryWrapper<VoteEvaluationTasks>().in(VoteEvaluationTasks::getJudgeId, judgeIds).in(VoteEvaluationTasks::getSubmissionId, submissionIds)
+                new LambdaQueryWrapper<VoteEvaluationTasks>().in(VoteEvaluationTasks::getJudgeId, judgeIds).eq(VoteEvaluationTasks::getRoundId, roundId).in(VoteEvaluationTasks::getSubmissionId, submissionIds)
         );
         // 按专家ID分组任务列表
         Map<String, List<VoteEvaluationTasks>> tasksGroupedByJudge = allTasks.stream()
@@ -729,13 +741,13 @@ public class VoteDataStatisServiceImpl implements VoteDataStatisService {
     /**
      * 计算专家任务总数或完成数
      */
-    private Integer getJudgesTaskTotal(List<String> judgeIds, boolean isCompleted, List<VoteSubmission> voteSubmissions) {
+    private Integer getJudgesTaskTotal(List<String> judgeIds, boolean isCompleted, List<VoteSubmission> voteSubmissions, Long roundId) {
         if (judgeIds == null || judgeIds.isEmpty()) {
             return 0;
         }
         List<Long> submissionIds = voteSubmissions.stream().map(VoteSubmission::getId).collect(Collectors.toList());//该活动轮次下的作品
         LambdaQueryWrapper<VoteEvaluationTasks> wrapper = new LambdaQueryWrapper<>();
-        wrapper.in(VoteEvaluationTasks::getJudgeId, judgeIds).in(VoteEvaluationTasks::getSubmissionId, submissionIds);
+        wrapper.in(VoteEvaluationTasks::getJudgeId, judgeIds).eq(VoteEvaluationTasks::getRoundId, roundId).in(VoteEvaluationTasks::getSubmissionId, submissionIds);
         if (isCompleted) {
             wrapper.eq(VoteEvaluationTasks::getStatus, "1");  // 已完成状态
         }

+ 167 - 80
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEvaluationTasksServiceImpl.java

@@ -32,6 +32,8 @@ import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
+import static com.vote.system.util.ConstantUtils.IS_DELETED_0;
+
 /**
  * @author MacBook
  * @description 针对表【vote_evaluation_tasks(评选任务表)】的数据库操作Service实现
@@ -76,53 +78,75 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
     @Override
     public VoteEvaluationTasksCountVo getStatistics(VoteEvaluationTasksDto voteEvaluationTasksDto) {
         VoteEvaluationTasksCountVo evaluationTasksVo = new VoteEvaluationTasksCountVo();
-
+        if (voteEvaluationTasksDto == null || voteEvaluationTasksDto.getEventId() == null || voteEvaluationTasksDto.getWorkSettingsId() == null) {
+            return evaluationTasksVo;
+        }
         // 构建查询条件
         LambdaQueryWrapper<VoteSubmission> submissionWrapper = new LambdaQueryWrapper<>();
-        submissionWrapper.eq(VoteSubmission::getEventId, voteEvaluationTasksDto.getEventId()).eq(VoteSubmission::getWorkSettingsId, voteEvaluationTasksDto.getWorkSettingsId());
+        submissionWrapper.eq(VoteSubmission::getEventId, voteEvaluationTasksDto.getEventId())
+                .eq(VoteSubmission::getWorkSettingsId, voteEvaluationTasksDto.getWorkSettingsId())
+                .eq(VoteSubmission::getEventId, voteEvaluationTasksDto.getEventId())
+                .eq(VoteSubmission::getRoundId, voteEvaluationTasksDto.getRoundId());
         List<VoteSubmission> submissions = voteSubmissionMapper.selectList(submissionWrapper);
         evaluationTasksVo.setSubMissionCount(submissions.size()); // 作品数
-
         // 统计已完成的总分数
         BigDecimal totalScore = BigDecimal.ZERO; // 使用 BigDecimal 来处理可能的浮点数运算
 
         if (!submissions.isEmpty()) {
-            // 从 submissions 中提取出所有的 submissionId
-            List<Long> submissionIds = submissions.stream().map(VoteSubmission::getId).collect(Collectors.toList());
+            List<Long> submissionIds = submissions.stream()
+                    .map(VoteSubmission::getId)
+                    .collect(Collectors.toList());
 
             // 创建查询包装器,用于查询 VoteEventRegistrationWorkScores 表
             LambdaQueryWrapper<VoteEventRegistrationWorkScores> scoresWrapper = new LambdaQueryWrapper<>();
-            scoresWrapper.in(VoteEventRegistrationWorkScores::getSubmissionId, submissionIds);
-
-            // 执行查询,获取所有与 submissionIds 相关的评分记录
-            List<VoteEventRegistrationWorkScores> workScores = voteEventRegistrationWorkScoresMapper.selectList(scoresWrapper);
 
-            // 统计所有已完成的评分记录的总分数
-            totalScore = workScores.stream().filter(scores -> scores.getScore() != null && scores.getScore().compareTo(BigDecimal.ZERO) > 0).map(VoteEventRegistrationWorkScores::getScore).reduce(BigDecimal.ZERO, BigDecimal::add); // 计算总分数
+            // 检查 submissionIds 是否为空
+            if (!submissionIds.isEmpty()) {
+                scoresWrapper.in(VoteEventRegistrationWorkScores::getSubmissionId, submissionIds)
+                        .eq(VoteEventRegistrationWorkScores::getRoundId, voteEvaluationTasksDto.getRoundId());
+                // 执行查询,获取所有与 submissionIds 相关的评分记录
+                List<VoteEventRegistrationWorkScores> workScores = voteEventRegistrationWorkScoresMapper.selectList(scoresWrapper);
+                totalScore = workScores.stream()
+                        .filter(scores -> scores.getScore() != null && scores.getScore().compareTo(BigDecimal.ZERO) > 0)
+                        .map(VoteEventRegistrationWorkScores::getScore)
+                        .reduce(BigDecimal.ZERO, BigDecimal::add);
+            }
         }
         evaluationTasksVo.setFinishedCount(totalScore);
 
         // 评审专家数量
         VoteEventEvaluationRounds evaluationRounds = voteEventEvaluationRoundsMapper.selectById(voteEvaluationTasksDto.getRoundId());
-        String[] judgeIds = evaluationRounds.getJudges().split(",");
-        evaluationTasksVo.setJudgesCount(judgeIds.length);
-
-        // 统计已完成评审的专家数
-        int finishedJudgesCount = 0;
-        if (judgeIds.length > 0) {
-            LambdaQueryWrapper<VoteEvaluationTasks> tasksWrapper = new LambdaQueryWrapper<>();
-            tasksWrapper.in(VoteEvaluationTasks::getJudgeId, Arrays.asList(judgeIds)).eq(VoteEvaluationTasks::getStatus, 1);
-            List<Long> submissionIds = voteEvaluationTasksMapper.selectList(tasksWrapper).stream().map(VoteEvaluationTasks::getSubmissionId).collect(Collectors.toList());
-             //过滤掉不是该活动 该类型 该轮次的作品
-            LambdaQueryWrapper<VoteSubmission> wrapper = new LambdaQueryWrapper<>();
-            wrapper.eq(VoteSubmission::getEventId, voteEvaluationTasksDto.getEventId())
-                    .eq(VoteSubmission::getWorkSettingsId, voteEvaluationTasksDto.getWorkSettingsId())
-                    .eq(VoteSubmission::getRoundId, voteEvaluationTasksDto.getRoundId())
-                    .in(VoteSubmission::getId, submissionIds);
-            finishedJudgesCount = voteSubmissionMapper.selectList(wrapper).size();
-
+        if (evaluationRounds != null && evaluationRounds.getJudges() != null) {
+            String[] judgeIds = evaluationRounds.getJudges().split(",");
+            evaluationTasksVo.setJudgesCount(judgeIds.length);
+
+            // 统计已完成评审的专家数
+            int finishedJudgesCount = 0;
+            if (judgeIds.length > 0) {
+                LambdaQueryWrapper<VoteEvaluationTasks> tasksWrapper = new LambdaQueryWrapper<>();
+                tasksWrapper.in(VoteEvaluationTasks::getJudgeId, Arrays.asList(judgeIds))
+                        .eq(VoteEvaluationTasks::getStatus, 1)
+                        .eq(VoteEvaluationTasks::getRoundId, voteEvaluationTasksDto.getRoundId());
+                List<Long> submissionIds = voteEvaluationTasksMapper.selectList(tasksWrapper)
+                        .stream()
+                        .map(VoteEvaluationTasks::getSubmissionId)
+                        .collect(Collectors.toList());
+                if (!submissionIds.isEmpty()) {
+                    LambdaQueryWrapper<VoteSubmission> wrapper = new LambdaQueryWrapper<>();
+                    wrapper.eq(VoteSubmission::getEventId, voteEvaluationTasksDto.getEventId())
+                            .eq(VoteSubmission::getWorkSettingsId, voteEvaluationTasksDto.getWorkSettingsId())
+                            .eq(VoteSubmission::getRoundId, voteEvaluationTasksDto.getRoundId())
+                            .in(VoteSubmission::getId, submissionIds);
+                    List<VoteSubmission> voteSubmissions = voteSubmissionMapper.selectList(wrapper);
+                    finishedJudgesCount = voteSubmissions.size();
+                }
+            }
+            evaluationTasksVo.setFinishedJudgesCount(finishedJudgesCount);
+        } else {
+            evaluationTasksVo.setJudgesCount(0);
+            evaluationTasksVo.setFinishedJudgesCount(0);
         }
-        evaluationTasksVo.setFinishedJudgesCount(finishedJudgesCount);
+
         return evaluationTasksVo;
     }
 
@@ -135,7 +159,7 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
      */
     @Override
     public IPage<VoteJudgeTaskInfoVo> selectPage(VoteEvaluationTasksDto voteEvaluationTasksDto) {
-        //分页参数
+        // 分页参数
         long pageNum = Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_NUM), 1L);
         long pageSize = Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_SIZE), 10L);
         Page<VoteJudgeTaskInfoVo> page = new Page<>(pageNum, pageSize);
@@ -144,44 +168,60 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
                 .eq(VoteEventCompetitionZones::getWorkSettingsId, voteEvaluationTasksDto.getWorkSettingsId())
                 .eq(VoteEventCompetitionZones::getRoundId, voteEvaluationTasksDto.getRoundId())
                 .eq(VoteEventCompetitionZones::getStatus, "1");
+
         List<VoteEventCompetitionZones> zones = voteEventCompetitionZonesMapper.selectList(wrapper);
-        //获取所有作品id
+
+        // 获取所有作品id
         LambdaQueryWrapper<VoteSubmission> submissionWrapper = new LambdaQueryWrapper<>();
         submissionWrapper.eq(VoteSubmission::getEventId, voteEvaluationTasksDto.getEventId())
                 .eq(VoteSubmission::getWorkSettingsId, voteEvaluationTasksDto.getWorkSettingsId())
                 .eq(VoteSubmission::getRoundId, voteEvaluationTasksDto.getRoundId());
-        List<Long> submissionIds = voteSubmissionMapper.selectList(submissionWrapper).stream().map(VoteSubmission::getId).collect(Collectors.toList());
-        String[] judgeIds = zones.stream()
+
+        List<Long> submissionIds = voteSubmissionMapper.selectList(submissionWrapper)
+                .stream()
+                .map(VoteSubmission::getId)
+                .collect(Collectors.toList());
+
+        // 构建
+        Set<String> judgeIds = zones.stream()
                 .map(VoteEventCompetitionZones::getJudges)
-                .filter(Objects::nonNull) // 避免空值
-                .flatMap(judges -> Arrays.stream(judges.split(","))) // 分割每个 judge 字符串
-                .toArray(String[]::new);
-        // 获取专家数据和省份数据,避免频繁调用服务
-        List<SysPlatformUser> users = Optional.ofNullable(remotePlatformUserService.processExpertList().getData()).orElse(Collections.emptyList());
-        List<SysProvince> provinces = Optional.ofNullable(remoteSysProvinceService.getProvince().getData()).orElse(Collections.emptyList());
-        // 初始化返回的结果集
-        List<VoteJudgeTaskInfoVo> judgeTaskInfoList = new ArrayList<>();
-
-        // 遍历每个专家ID,获取任务数、已完成数、专家名称及赛区信息
+                .filter(Objects::nonNull)
+                .flatMap(judges -> Arrays.stream(judges.split(",")))
+                .collect(Collectors.toSet()); // Use Set to avoid duplicates
+
+        // Get expert and province data
+        List<SysPlatformUser> users = Optional.ofNullable(remotePlatformUserService.processExpertList().getData())
+                .orElse(Collections.emptyList());
+        List<SysProvince> provinces = Optional.ofNullable(remoteSysProvinceService.getProvince().getData())
+                .orElse(Collections.emptyList());
+
+        // Initialize result collection
+        Map<String, VoteJudgeTaskInfoVo> judgeTaskInfoMap = new HashMap<>();
+
+        // Iterate through each unique judge ID
         for (String judgeId : judgeIds) {
             if (judgeId == null || judgeId.trim().isEmpty()) {
-                continue; // 跳过空的专家ID
+                continue; // Skip empty judge IDs
             }
 
-            VoteJudgeTaskInfoVo judgeTaskInfo = new VoteJudgeTaskInfoVo();
+            VoteJudgeTaskInfoVo judgeTaskInfo = judgeTaskInfoMap.getOrDefault(judgeId, new VoteJudgeTaskInfoVo());
 
-            // 获取专家名称,设置默认值
-            String judgeName = users.stream().filter(user -> judgeId.equals(user.getUserId().toString())).map(SysPlatformUser::getNickName).findFirst().orElse("未知专家");
+            // Get expert name
+            String judgeName = users.stream()
+                    .filter(user -> judgeId.equals(user.getUserId().toString()))
+                    .map(SysPlatformUser::getNickName)
+                    .findFirst()
+                    .orElse("未知专家");
 
-            // 计算任务数和已完成任务数
-            int taskCount = calculateTaskCount(new String[]{judgeId}, submissionIds, false);
-            int doneTaskCount = calculateTaskCount(new String[]{judgeId}, submissionIds, true);
+            // Calculate task counts
+            int taskCount = calculateTaskCount(new String[]{judgeId}, submissionIds, false, voteEvaluationTasksDto.getRoundId());
+            int doneTaskCount = calculateTaskCount(new String[]{judgeId}, submissionIds, true, voteEvaluationTasksDto.getRoundId());
 
-            // 查询专家所在的赛区及相关省份,并设置默认值
-            Map<String, String> zonesAndProvinces = findZoneNamesAndProvincesByJudgeId(judgeId);
+            // Query zone and province information
+            Map<String, String> zonesAndProvinces = findZoneNamesAndProvincesByJudgeId(judgeId, voteEvaluationTasksDto);
             String provinceNames = getProvinceNames(zonesAndProvinces.get("provinces"), provinces);
 
-            // 填充信息到结果对象
+            // Populate information
             judgeTaskInfo.setJudgeName(judgeName);
             judgeTaskInfo.setJudgeId(Long.valueOf(judgeId));
             judgeTaskInfo.setTaskCount(taskCount);
@@ -190,15 +230,18 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
             judgeTaskInfo.setZonesName(Optional.ofNullable(zonesAndProvinces.get("zoneNames")).orElse("未知赛区"));
             judgeTaskInfo.setProvince(Optional.ofNullable(provinceNames).orElse("未知省份"));
 
-            // 加入结果集
-            judgeTaskInfoList.add(judgeTaskInfo);
+            // Update the map
+            judgeTaskInfoMap.put(judgeId, judgeTaskInfo);
         }
-        page.setRecords(judgeTaskInfoList);
-        page.setTotal(judgeTaskInfoList.size());
+
+        // Set results to page
+        page.setRecords(new ArrayList<>(judgeTaskInfoMap.values()));
+        page.setTotal(judgeTaskInfoMap.size());
 
         return page;
     }
 
+
     /**
      * 查询详情
      *
@@ -215,11 +258,13 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
         // 查询评估任务
         LambdaQueryWrapper<VoteEvaluationTasks> taskWrapper = new LambdaQueryWrapper<>();
         taskWrapper.eq(VoteEvaluationTasks::getJudgeId, voteEvaluationTasksDto.getJudgeId());
+        taskWrapper.eq(VoteEvaluationTasks::getRoundId, voteEvaluationTasksDto.getRoundId());
         if ("1".equals(voteEvaluationTasksDto.getType())) {
             taskWrapper.eq(VoteEvaluationTasks::getStatus, "0");
         } else if ("2".equals(voteEvaluationTasksDto.getType())) {
             taskWrapper.eq(VoteEvaluationTasks::getStatus, "1");
         }
+        taskWrapper.eq(VoteEvaluationTasks::getRoundId, voteEvaluationTasksDto.getRoundId());
         List<VoteEvaluationTasks> tasks = voteEvaluationTasksMapper.selectList(taskWrapper);
 
         if (tasks.isEmpty()) {
@@ -234,15 +279,16 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
                 .eq(VoteSubmission::getWorkSettingsId, voteEvaluationTasksDto.getWorkSettingsId())
                 .eq(VoteSubmission::getRoundId, voteEvaluationTasksDto.getRoundId());
         List<VoteSubmission> submissions = voteSubmissionMapper.selectList(wrapper);
-
         // 获取所有相关的评分信息
-        List<Long> eventIds = submissions.stream().map(VoteSubmission::getEventId).distinct().collect(Collectors.toList());
-        List<VoteEventRegistrationWorkScores> scoresList = voteEventRegistrationWorkScoresMapper.selectList(new LambdaQueryWrapper<VoteEventRegistrationWorkScores>().in(VoteEventRegistrationWorkScores::getSubmissionId, submissionIds).in(VoteEventRegistrationWorkScores::getEventId, eventIds).eq(VoteEventRegistrationWorkScores::getJudgeId, voteEvaluationTasksDto.getJudgeId()));
+        List<VoteEventRegistrationWorkScores> scoresList = voteEventRegistrationWorkScoresMapper.selectList(new LambdaQueryWrapper<VoteEventRegistrationWorkScores>()
+                .in(VoteEventRegistrationWorkScores::getSubmissionId, submissionIds)
+                .eq(VoteEventRegistrationWorkScores::getEventId, voteEvaluationTasksDto.getEventId())
+                .eq(VoteEventRegistrationWorkScores::getJudgeId, voteEvaluationTasksDto.getJudgeId())
+                .eq(VoteEventRegistrationWorkScores::getRoundId, voteEvaluationTasksDto.getRoundId()));
 
         // 获取所有相关的幼儿园信息
         List<Long> locationIds = submissions.stream().map(VoteSubmission::getLocationId).distinct().collect(Collectors.toList());
         Map<Long, SysBranchKindergartenDto> branchMap = getBranchMap(locationIds);
-
         // 处理任务和评分数据
         Map<String, VoteEventRegistrationWorkScores> scoresMap = scoresList.stream().collect(Collectors.toMap(score -> score.getSubmissionId() + "-" + score.getEventId(), Function.identity()));
 
@@ -257,8 +303,11 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
 
             // 无论 submission 是否为空,都设置对应的字段
             if (submission != null) {
-                scoresVo.setSubmissionName(submission.getName())
-                        .setCommitName(submission.getCommitName());
+                scoresVo.setSubmissionName(submission.getName());
+                LambdaQueryWrapper<VoteRegistrations> queryWrapper = new LambdaQueryWrapper<>();
+                queryWrapper.eq(VoteRegistrations::getUid, submission.getUserId())
+                        .eq(VoteRegistrations::getEventId, submission.getEventId());
+                scoresVo.setCommitName(voteRegistrationsMapper.selectList(queryWrapper).get(0).getName());
             } else {
                 return null;
             }
@@ -298,7 +347,11 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
         long pageSize = Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_SIZE), 10L);
         // 构建查询条件
         LambdaQueryWrapper<VoteEventCompetitionZones> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(VoteEventCompetitionZones::getEventId, voteEvaluationTasksDto.getEventId()).eq(VoteEventCompetitionZones::getRoundId, voteEvaluationTasksDto.getRoundId()).eq(VoteEventCompetitionZones::getWorkSettingsId, voteEvaluationTasksDto.getWorkSettingsId()).orderByDesc(VoteEventCompetitionZones::getCreatedAt);
+        wrapper.eq(VoteEventCompetitionZones::getEventId, voteEvaluationTasksDto.getEventId())
+                .eq(VoteEventCompetitionZones::getRoundId, voteEvaluationTasksDto.getRoundId())
+                .eq(VoteEventCompetitionZones::getWorkSettingsId, voteEvaluationTasksDto.getWorkSettingsId())
+                .eq(VoteEventCompetitionZones::getIsDeleted, IS_DELETED_0)
+                .orderByDesc(VoteEventCompetitionZones::getCreatedAt);
         List<VoteEventCompetitionZones> competitionZones = voteEventCompetitionZonesMapper.selectList(wrapper);
         // 调用获取所有省份
         List<SysProvince> provinces = remoteSysProvinceService.getProvince().getData();
@@ -387,7 +440,7 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
     }
 
     // 获取任务数和已完成数
-    private int calculateTaskCount(String[] judgeIds, List<Long> submissionIds, boolean includeJudgeCondition) {
+    private int calculateTaskCount(String[] judgeIds, List<Long> submissionIds, boolean includeJudgeCondition, Long roundId) {
         if (judgeIds == null || judgeIds.length == 0 || submissionIds == null || submissionIds.isEmpty()) {
             return 0; // 如果 judgeIds 或 submissionIds 为空,直接返回 0
         }
@@ -398,6 +451,8 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
         // 根据 submissionIds 查询
         queryWrapper.in(VoteEvaluationTasks::getSubmissionId, submissionIds);
 
+        queryWrapper.eq(VoteEvaluationTasks::getRoundId, roundId);
+
         // 如果需要根据任务状态查询,添加相应的条件
         if (includeJudgeCondition) {
             queryWrapper.eq(VoteEvaluationTasks::getStatus, 1); // 1表示已完成
@@ -410,26 +465,24 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
 
 
     //获取赛区名 和 相关的省份
-    public Map<String, String> findZoneNamesAndProvincesByJudgeId(String judgeId) {
+    public Map<String, String> findZoneNamesAndProvincesByJudgeId(String judgeId, VoteEvaluationTasksDto voteEvaluationTasksDto) {
         if (judgeId == null || judgeId.trim().isEmpty()) {
             // 如果 judgeId 为空,返回空的 Map
             return Collections.emptyMap();
         }
-
         LambdaQueryWrapper<VoteEventCompetitionZones> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.like(VoteEventCompetitionZones::getJudges, "," + judgeId + ",").or().like(VoteEventCompetitionZones::getJudges, judgeId + ",").or().like(VoteEventCompetitionZones::getJudges, "," + judgeId).or().eq(VoteEventCompetitionZones::getJudges, judgeId);
-
+        queryWrapper
+                .eq(VoteEventCompetitionZones::getRoundId, voteEvaluationTasksDto.getRoundId())
+                .eq(VoteEventCompetitionZones::getEventId, voteEvaluationTasksDto.getEventId())
+                .eq(VoteEventCompetitionZones::getWorkSettingsId, voteEvaluationTasksDto.getWorkSettingsId())
+                .eq(VoteEventCompetitionZones::getIsDeleted, IS_DELETED_0);
         List<VoteEventCompetitionZones> zones = Optional.ofNullable(voteEventCompetitionZonesMapper.selectList(queryWrapper)).orElse(Collections.emptyList());
-
         // 提取 name 字段和 provinces 字段,并用逗号拼接成一个字符串
         String zoneNames = zones.stream().map(VoteEventCompetitionZones::getName).filter(Objects::nonNull).collect(Collectors.joining(","));
-
         String provinces = zones.stream().map(VoteEventCompetitionZones::getProvinces).filter(Objects::nonNull).collect(Collectors.joining(","));
-
         Map<String, String> result = new HashMap<>();
         result.put("zoneNames", zoneNames.isEmpty() ? "暂未分配赛区" : zoneNames);
         result.put("provinces", provinces.isEmpty() ? "" : provinces);
-
         return result;
     }
 
@@ -458,11 +511,44 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
         if (voteSubmissions == null || voteSubmissions.isEmpty()) {
             throw new RuntimeException("该赛区下暂无作品,分配失败");
         }
-        //收集主键
-        List<Long> submissionIds = voteSubmissions.stream()
-                .map(VoteSubmission::getId)
-                .collect(Collectors.toList());
-
+        // 获取赛区信息
+        LambdaQueryWrapper<VoteEventCompetitionZones> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(VoteEventCompetitionZones::getEventId, voteEvaluationTasksDto.getEventId())
+                .eq(VoteEventCompetitionZones::getWorkSettingsId, voteEvaluationTasksDto.getWorkSettingsId())
+                .eq(VoteEventCompetitionZones::getRoundId, voteEvaluationTasksDto.getRoundId());
+        List<VoteEventCompetitionZones> voteEventCompetitionZones = voteEventCompetitionZonesMapper.selectList(queryWrapper);
+
+        // 收集所有作品ID
+        List<Long> submissionIds = new ArrayList<>();
+        for (VoteEventCompetitionZones voteEventCompetitionZone : voteEventCompetitionZones) {
+            String provinces = voteEventCompetitionZone.getProvinces(); // 赛区下省份
+            String[] split = provinces.split(",");
+
+            for (String province : split) {
+                // 获取该省份的报名数据
+                LambdaQueryWrapper<VoteRegistrations> registrationWrapper = new LambdaQueryWrapper<>();
+                registrationWrapper.eq(VoteRegistrations::getProvinceId, province);
+                List<VoteRegistrations> registrations = voteRegistrationsMapper.selectList(registrationWrapper);
+                // 通过报名数据获取作品ID
+                for (VoteRegistrations registration : registrations) {
+                    Long uid = registration.getUid(); // 获取用户ID
+                    LambdaQueryWrapper<VoteSubmission> submissionWrapper = new LambdaQueryWrapper<>();
+                    submissionWrapper.eq(VoteSubmission::getUserId, uid);
+                    submissionWrapper.eq(VoteSubmission::getEventId, voteEvaluationTasksDto.getEventId());
+                    submissionWrapper.eq(VoteSubmission::getWorkSettingsId, voteEvaluationTasksDto.getWorkSettingsId());
+                    submissionWrapper.eq(VoteSubmission::getRoundId, voteEvaluationTasksDto.getRoundId());
+                    List<VoteSubmission> userSubmissions = voteSubmissionMapper.selectList(submissionWrapper);
+                    submissionIds.addAll(userSubmissions.stream()
+                            .map(VoteSubmission::getId)
+                            .collect(Collectors.toList()));
+                }
+            }
+        }
+        // 继续后续逻辑
+        if (submissionIds.isEmpty()) {
+            throw new RuntimeException("没有找到相关作品,分配失败");
+        }
+        voteSubmissionMapper.updateBatch(submissionIds);
         // 获取专家id数组
         VoteEventCompetitionZones competitionZones = voteEventCompetitionZonesMapper.selectById(voteEvaluationTasksDto.getZonesId());
         String judges = competitionZones.getJudges();
@@ -499,7 +585,7 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
                 assignmentMap.get(randomJudgeId).add(submissionIterator.next());
             }
         }
-        List<VoteEvaluationTasks> tasksToInsert = getVoteEvaluationTasks(assignmentMap);
+        List<VoteEvaluationTasks> tasksToInsert = getVoteEvaluationTasks(assignmentMap, voteEvaluationTasksDto.getRoundId());
         // 批量插入任务到数据库
         if (!tasksToInsert.isEmpty()) {
             int i = voteEvaluationTasksMapper.insertBatch(tasksToInsert);
@@ -517,7 +603,7 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
 
 
     //构建插入任务
-    private List<VoteEvaluationTasks> getVoteEvaluationTasks(Map<String, List<Long>> assignmentMap) {
+    private List<VoteEvaluationTasks> getVoteEvaluationTasks(Map<String, List<Long>> assignmentMap, Long roundId) {
         List<VoteEvaluationTasks> tasksToInsert = new ArrayList<>();
         for (Map.Entry<String, List<Long>> entry : assignmentMap.entrySet()) {
             String judgeId = entry.getKey();
@@ -527,6 +613,7 @@ public class VoteEvaluationTasksServiceImpl extends ServiceImpl<VoteEvaluationTa
                 VoteEvaluationTasks task = new VoteEvaluationTasks();
                 task.setJudgeId(judgeId);
                 task.setSubmissionId(submissionId);
+                task.setRoundId(roundId);
                 tasksToInsert.add(task);
             }
         }

+ 87 - 10
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEventAppletServiceImpl.java

@@ -11,6 +11,7 @@ import com.vctgo.common.core.text.Convert;
 import com.vctgo.common.core.utils.ServletUtils;
 import com.vctgo.common.core.web.domain.AjaxResult;
 import com.vctgo.common.mybatisplus.constant.MybatisPageConstants;
+import com.vctgo.common.security.utils.SecurityUtils;
 import com.vctgo.system.api.RemoteBranchKindergartenService;
 import com.vctgo.system.api.RemoteFileService;
 import com.vctgo.system.api.RemoteTeachStaffService;
@@ -74,16 +75,16 @@ public class VoteEventAppletServiceImpl implements VoteEventAppletService {
     private VoteEventWorkSettingsMapper voteEventWorkSettingsMapper;
 
     @Autowired
-    private VoteDataStorageMapper voteDataStorageMapper;
+    private VoteEventEvaluationRoundsMapper voteEventEvaluationRoundsMapper;
 
     @Autowired
-    private RemoteUserService remoteUserService;
+    private VoteWorkTypesMapper voteWorkTypesMapper;
 
     @Autowired
-    private RemoteTeachStaffService remoteTeachStaffService;
+    private RemoteUserService remoteUserService;
 
     @Autowired
-    private RemoteFileService remoteFileService;
+    private RemoteTeachStaffService remoteTeachStaffService;
 
     @Autowired
     private RemoteBranchKindergartenService remoteBranchKindergartenService;
@@ -102,6 +103,7 @@ public class VoteEventAppletServiceImpl implements VoteEventAppletService {
                 .orderByDesc(VoteEvents::getCreatedAt);
         List<VoteEvents> events = voteEventsMapper.selectList(voteEventsLambdaQueryWrapper);
         LambdaQueryWrapper<VoteEventNewsCarousels> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(VoteEventNewsCarousels::getIsDelete, IS_DELETED_0);
         queryWrapper.orderByDesc(VoteEventNewsCarousels::getSortOrder);
         List<VoteEventNewsCarousels> carousels = voteEventNewsCarouselsMapper.selectList(queryWrapper);
         newsVo.setEventsList(events);
@@ -152,7 +154,32 @@ public class VoteEventAppletServiceImpl implements VoteEventAppletService {
 //        if (data == null) {
 //            return AjaxResult.error(NO_EXISTING, "查询不到该用户的所在园所,请先添加园所");
 //        }
+        LambdaQueryWrapper<VoteEvents> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(VoteEvents::getIsDeleted, commit_shelves);
+        queryWrapper.eq(VoteEvents::getStatus, commit_shelves);
+        queryWrapper.orderByDesc(VoteEvents::getCreatedAt); // 添加按更新时间降序排序
+        VoteEvents voteEvents = null;
+// 空值检查
+        if (voteEventsMapper == null) {
+            throw new NullPointerException("活动还未发布");
+        }
+
+        try {
+            // 获取最近的一条数据
+            voteEvents = voteEventsMapper.selectOne(queryWrapper);
+        } catch (Exception e) {
+            // 异常处理
+            System.err.println("Error occurred during database operation: " + e.getMessage());
+            throw new RuntimeException("Database operation failed", e);
+        }
+
+        // 边界条件处理
+        if (voteEvents == null) {
+            // 可以记录日志或抛出自定义异常
+            throw new NoSuchElementException("活动还未发布");
+        }
         voteRegistrationsDto.setLocationId(voteRegistrationsDto.getLocationId());
+        voteRegistrationsDto.setEventId(voteEvents.getId());
         voteRegistrationsDto.setCreatedAt(new Date());
         //回填教职工信息
         SysTeachStaffVo update = new SysTeachStaffVo();
@@ -175,7 +202,7 @@ public class VoteEventAppletServiceImpl implements VoteEventAppletService {
         LambdaQueryWrapper<VoteEventWorkSettings> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(VoteEventWorkSettings::getEventId, eventId);
         List<VoteEventWorkSettings> voteEventWorkSettings = voteEventWorkSettingsMapper.selectList(wrapper);
-        if (voteEventWorkSettings == null || voteEventWorkSettings.size() == 0) {
+        if (voteEventWorkSettings == null || voteEventWorkSettings.isEmpty()) {
             throw new RuntimeException("该活动下暂未配置类型信息");
         }
         ArrayList<VoteEventWorkSettings> workSettings = new ArrayList<>();
@@ -185,10 +212,30 @@ public class VoteEventAppletServiceImpl implements VoteEventAppletService {
             eventWorkSettings.setAlias(item.getAlias());
             eventWorkSettings.setEventId(item.getEventId());
             eventWorkSettings.setRoundsId(item.getRoundsId());
+            eventWorkSettings.setSubmissionStartDate(item.getSubmissionStartDate());
+            eventWorkSettings.setSubmissionEndDate(item.getSubmissionEndDate());
+            eventWorkSettings.setMaxSubmissions(item.getMaxSubmissions());
+            eventWorkSettings.setAllowModificationBeforeEvaluation(item.getAllowModificationBeforeEvaluation());
+            if (item.getRoundsId() != null) {
+                String[] split = item.getRoundsId().split(",");
+                if (split.length > 0) {
+                    String firstElement = split[0];
+                    // 使用第一个元素
+                    VoteEventEvaluationRounds rounds = voteEventEvaluationRoundsMapper.selectById(firstElement);
+                    eventWorkSettings.setElectSatTime(rounds.getStartDate());
+                    eventWorkSettings.setElectEndTime(rounds.getEndDate());
+                }
+            }
+            VoteWorkTypes workTypes = voteWorkTypesMapper.selectById(item.getWorkTypeId());
+            if (workTypes != null) {
+                eventWorkSettings.setWorkTypeName(workTypes.getName());
+            } else {
+                eventWorkSettings.setWorkTypeName("未知类型");
+            }
+
             workSettings.add(eventWorkSettings);
         });
         return workSettings;
-
     }
 
 
@@ -198,17 +245,45 @@ public class VoteEventAppletServiceImpl implements VoteEventAppletService {
     @Override
     @Transactional
     public int submission(VoteSubmissionDto voteSubmissionDto) {
+        // 查询用户的报名信息
         LambdaQueryWrapper<VoteRegistrations> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(VoteRegistrations::getUid, voteSubmissionDto.getUserId())
                 .eq(VoteRegistrations::getEventId, voteSubmissionDto.getEventId());
         VoteRegistrations voteRegistrations = voteRegistrationsMapper.selectOne(queryWrapper);
+        // 检查用户是否已报名
         if (voteRegistrations == null) {
             throw new ServiceException("暂未该用户的报名信息,请先报名");
         }
+        // 获取用户信息并设置到投票提交 DTO 中
         SysUser user = remoteUserService.getUserInfo(voteSubmissionDto.getUserId()).getData();
-        voteSubmissionDto.setCommitName(user.getNickName());
+//        if (user == null) {
+//            throw new ServiceException("用户信息未找到");
+//        }
+        voteSubmissionDto.setCommitName(SecurityUtils.getNickname());
         voteSubmissionDto.setLocationId(voteRegistrations.getLocationId());
         voteSubmissionDto.setCreateAt(new Date());
+        // 提交作品之后,将作品 ID 设置到该报名用户
+        VoteRegistrations registrations = new VoteRegistrations();
+        registrations.setWorkSettingsId(voteSubmissionDto.getWorkSettingsId());
+        // 更新报名用户的作品设置 ID
+        voteRegistrationsMapper.update(registrations, queryWrapper);
+        // 提交作品后默认进入第一轮次
+        VoteEventWorkSettings eventWorkSettings = voteEventWorkSettingsMapper.selectById(voteSubmissionDto.getWorkSettingsId());
+        if (eventWorkSettings == null) {
+            throw new ServiceException("作品设置未找到");
+        }
+        // 获取第一个轮次 ID 并设置到投票提交 DTO 中
+        String[] rounds = eventWorkSettings.getRoundsId().split(",");
+        if (rounds.length > 0) {
+            voteSubmissionDto.setRoundId(Long.valueOf(rounds[0])); // 设置第一轮的 ID
+        } else {
+            throw new ServiceException("轮次 ID 不存在");
+        }
+        LambdaQueryWrapper<VoteEvents> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(VoteEvents::getStatus, commit_shelves);
+        List<VoteEvents> voteEvents = voteEventsMapper.selectList(wrapper);
+        voteSubmissionDto.setEventId(voteEvents.get(0).getId());
+        // 插入作品并返回结果
         return voteSubmissionMapper.insert(voteSubmissionDto);
     }
 
@@ -244,6 +319,8 @@ public class VoteEventAppletServiceImpl implements VoteEventAppletService {
             vo.setEventsName(eventNames.get(voteSubmission.getEventId()));
             vo.setAgeSegment(processAgeSegment(voteSubmission.getAgeSegment(), ageSegmentMap));
             vo.setMainAuthor(voteSubmission.getMainAuthor());
+            vo.setAppraiseStatus(voteSubmission.getAppraiseStatus());
+            vo.setRemarks(voteSubmission.getRemarks());
             vo.setPhone(voteSubmission.getPhone());
             return vo;
         }).collect(Collectors.toList());
@@ -288,6 +365,7 @@ public class VoteEventAppletServiceImpl implements VoteEventAppletService {
         vo.setWorkStingsId(submission.getWorkSettingsId());
         vo.setEventId(submission.getEventId());
         vo.setSubmissionId(submissionId);
+        vo.setAppraiseStatus(submission.getAppraiseStatus());
         // 特殊处理评审状态
         if ("3".equals(submission.getAppraiseStatus())) {
             vo.setRemarks(submission.getRemarks());
@@ -439,10 +517,10 @@ public class VoteEventAppletServiceImpl implements VoteEventAppletService {
     @Override
     public String registrationsStatus(Long userid) {
         LambdaQueryWrapper<VoteRegistrations> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(VoteRegistrations::getIsDeleted, IS_DELETED_0);
         wrapper.eq(VoteRegistrations::getUid, userid);
         VoteRegistrations selectOne = voteRegistrationsMapper.selectOne(wrapper);
-        String userInfo = (selectOne == null) ? "3" : selectOne.getUserInfo();
-        return userInfo;
+        return (selectOne == null) ? "3" : selectOne.getUserInfo();
     }
 
     /**
@@ -551,7 +629,6 @@ public class VoteEventAppletServiceImpl implements VoteEventAppletService {
         voteEventNewsMapper.updateNewsLikeCount(newsId);
     }
 
-
     private String processAgeSegment(String ageSegment, Map<String, String> ageSegmentMap) {
         if (ageSegment == null) {
             return "";

+ 12 - 4
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEventCompetitionZonesServiceImpl.java

@@ -146,7 +146,6 @@ public class VoteEventCompetitionZonesServiceImpl extends ServiceImpl<VoteEventC
         // 分页参数
         long pageNum = Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_NUM), 1L);
         long pageSize = Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_SIZE), 10L);
-        Page<VoteEventCompetitionZonesVo> page = new Page<>(pageNum, pageSize);
         // 参数校验
         if (voteEventCompetitionZones.getEventId() == null) {
             throw new RuntimeException("活动id不能为空!");
@@ -158,6 +157,8 @@ public class VoteEventCompetitionZonesServiceImpl extends ServiceImpl<VoteEventC
         LambdaQueryWrapper<VoteEventCompetitionZones> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(VoteEventCompetitionZones::getEventId, voteEventCompetitionZones.getEventId());
         wrapper.eq(VoteEventCompetitionZones::getWorkSettingsId, voteEventCompetitionZones.getWorkSettingsId());
+        wrapper.eq(VoteEventCompetitionZones::getEventId, voteEventCompetitionZones.getEventId());
+        wrapper.eq(VoteEventCompetitionZones::getRoundId, voteEventCompetitionZones.getRoundId());
         wrapper.eq(VoteEventCompetitionZones::getIsDeleted, IS_DELETED_0);
         wrapper.orderByDesc(VoteEventCompetitionZones::getCreatedAt);
         List<VoteEventCompetitionZones> competitionZones = voteEventCompetitionZonesMapper.selectList(wrapper);
@@ -198,8 +199,14 @@ public class VoteEventCompetitionZonesServiceImpl extends ServiceImpl<VoteEventC
             zonesVo.setProvinces(provincesBuilder.toString());
 
             // 计算作品数和提交人数
-            Long submissionCount = getCount(item.getProvinces(), voteEventCompetitionZones.getEventId(), voteEventCompetitionZones.getWorkSettingsId(), true);
-            Long registrationsCount = getCount(item.getProvinces(), voteEventCompetitionZones.getEventId(), voteEventCompetitionZones.getWorkSettingsId(), false);
+            Long submissionCount = getCount(item.getProvinces()
+                    , voteEventCompetitionZones.getEventId()
+                    , voteEventCompetitionZones.getWorkSettingsId()
+                    , true, voteEventCompetitionZones.getRoundId());
+            Long registrationsCount = getCount(item.getProvinces()
+                    , voteEventCompetitionZones.getEventId()
+                    , voteEventCompetitionZones.getWorkSettingsId()
+                    , false, voteEventCompetitionZones.getRoundId());
             zonesVo.setJudgesId(item.getJudges());
             zonesVo.setProvincesId(item.getProvinces());
             zonesVo.setSubmissionCount(submissionCount);
@@ -282,13 +289,14 @@ public class VoteEventCompetitionZonesServiceImpl extends ServiceImpl<VoteEventC
      * @param isSubmission   是否计算作品数,true 为作品数,false 为注册人数
      * @return 计算结果
      */
-    private Long getCount(String provinces, Long eventId, Long workSettingsId, boolean isSubmission) {
+    private Long getCount(String provinces, Long eventId, Long workSettingsId, boolean isSubmission, Long roundId) {
         // 选择对应的 Mapper 和对象类型
         LambdaQueryWrapper<?> wrapper;
         List<?> items;
         if (isSubmission) {
             wrapper = new LambdaQueryWrapper<VoteSubmission>()
                     .eq(VoteSubmission::getEventId, eventId)
+                    .eq(VoteSubmission::getRoundId, roundId)
                     .eq(VoteSubmission::getWorkSettingsId, workSettingsId);
             items = voteSubmissionMapper.selectList((LambdaQueryWrapper<VoteSubmission>) wrapper);
         } else {

+ 8 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEventNewsCarouselsServiceImpl.java

@@ -66,6 +66,14 @@ public class VoteEventNewsCarouselsServiceImpl extends ServiceImpl<VoteEventNews
         return voteEventNewsCarouselsMapper.insert(voteEventNewsCarousels);
     }
 
+    @Override
+    public int deleteById(Long id) {
+        VoteEventNewsCarousels voteEventNewsCarousels = new VoteEventNewsCarousels();
+        voteEventNewsCarousels.setId(id)
+                .setIsDelete("1");
+        return voteEventNewsCarouselsMapper.updateById(voteEventNewsCarousels);
+    }
+
 }
 
 

+ 6 - 2
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEventNewsServiceImpl.java

@@ -72,8 +72,12 @@ public class VoteEventNewsServiceImpl extends ServiceImpl<VoteEventNewsMapper, V
                     normalNews.add(item);
                 }
             });
-            // 按创建时间降序排列置顶新闻
-            topNews.sort(Comparator.comparing(VoteEventNews::getCreatedAt).reversed());
+            //置顶倒叙
+            topNews.sort((n1, n2) -> n2.getUpdatedAt().compareTo(n1.getUpdatedAt()));
+
+            //非置顶倒叙
+            normalNews.sort((n1, n2) -> n2.getUpdatedAt().compareTo(n1.getUpdatedAt()));
+
             // 合并置顶和非置顶新闻
             topNews.addAll(normalNews);
             eventNews = topNews;

+ 61 - 8
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEventWorkSettingsServiceImpl.java

@@ -18,6 +18,9 @@ import org.springframework.transaction.annotation.Transactional;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import static com.vote.system.util.ConstantUtils.IS_DELETED_1;
+import static com.vote.system.util.ConstantUtils.commit_shelves;
+
 /**
  * @author MacBook
  * @description 针对表【vote_event_work_settings(活动作品设置表)】的数据库操作Service实现
@@ -48,6 +51,8 @@ public class VoteEventWorkSettingsServiceImpl extends ServiceImpl<VoteEventWorkS
 
     @Autowired
     private RemotePlatformUserService remotePlatformUserService;
+    @Autowired
+    private VoteSubmissionMapper voteSubmissionMapper;
 
 
     /**
@@ -67,10 +72,12 @@ public class VoteEventWorkSettingsServiceImpl extends ServiceImpl<VoteEventWorkS
         if (eventWorkSettings == null || eventWorkSettings.isEmpty()) {
             workSettingsVo.setName(voteEvents.getName());
             workSettingsVo.setId(voteEvents.getId());
+            workSettingsVo.setStatus(voteEvents.getStatus());
             return workSettingsVo;
         }
         workSettingsVo.setName(voteEvents.getName());
         workSettingsVo.setId(voteEvents.getId());
+        workSettingsVo.setStatus(voteEvents.getStatus());
         // 定义并初始化工作类型映射
         final Map<Long, VoteWorkTypes> workTypesMap;
         Set<Long> workTypeIds = eventWorkSettings.stream()
@@ -138,6 +145,9 @@ public class VoteEventWorkSettingsServiceImpl extends ServiceImpl<VoteEventWorkS
     public Map<String, String> getJudges() {
         Map<String, String> map = new HashMap<>();
         R<List<SysPlatformUser>> listR = remotePlatformUserService.processExpertList();
+        if (listR.getData() == null) {
+            return map;
+        }
         listR.getData().forEach(user -> {
             map.put(String.valueOf(user.getUserId()), user.getNickName());
         });
@@ -155,12 +165,17 @@ public class VoteEventWorkSettingsServiceImpl extends ServiceImpl<VoteEventWorkS
 
         // 检查输入参数是否为null
         if (workSettingsDto == null) {
-            throw new IllegalArgumentException("暂未关联任何活动");
+            return AjaxResult.error("暂未关联任何活动");
         }
         if (workSettingsDto.getAlias() == null || workSettingsDto.getAlias().isEmpty()) {
             return AjaxResult.error("类型别称不允许为空");
+
         }
 
+        VoteEvents voteEvents = voteEventsMapper.selectById(workSettingsDto.getEventId());
+        if (voteEvents.getStatus().equals(commit_shelves)) {
+            return AjaxResult.error("已发布作品,不允许修改");
+        }
         if (workSettingsDto.getId() == null) {
             // 插入新的记录
             voteEventWorkSettingsMapper.insert(workSettingsDto);
@@ -194,7 +209,6 @@ public class VoteEventWorkSettingsServiceImpl extends ServiceImpl<VoteEventWorkS
                             if (award != null) {
                                 award.setEventId(workSettingsDto.getEventId());
                                 awardsList.add(award);
-
                                 // 插入新的奖项记录并获取主键
                                 voteEventAwardsMapper.insert(award);
                                 awardsIdStrBuilder.append(award.getId()).append(",");
@@ -221,13 +235,34 @@ public class VoteEventWorkSettingsServiceImpl extends ServiceImpl<VoteEventWorkS
             if (roundsIdBuilder.length() > 0) {
                 roundsIdBuilder.setLength(roundsIdBuilder.length() - 1);
             }
-
             // 更新 workSettings 的 roundsId 和 awards 字段
             workSettingsDto.setRoundsId(roundsIdBuilder.toString());
-            voteEventWorkSettingsMapper.updateById(workSettingsDto);
+
+            // 补充逻辑 如果更新轮次也会更新作品轮次;
+            String roundsId = workSettingsDto.getRoundsId();
+            if (roundsId != null && !roundsId.isEmpty()) {
+                String[] split = roundsId.split(",");
+                if (split.length > 0) {
+                    // 取第一个元素
+                    String firstRoundId = split[0];
+                    LambdaQueryWrapper<VoteSubmission> wrapper = new LambdaQueryWrapper<>();
+                    wrapper.eq(VoteSubmission::getEventId, workSettingsDto.getEventId())
+                            .eq(VoteSubmission::getWorkSettingsId, workSettingsDto.getWorkSettingsId());
+                    List<VoteSubmission> submissions = voteSubmissionMapper.selectList(wrapper);
+                    if (submissions != null && !submissions.isEmpty()) {
+                        for (VoteSubmission submission : submissions) {
+                            submission.setRoundId(Long.valueOf(firstRoundId));
+                            // 更新数据库
+                            voteSubmissionMapper.updateById(submission);
+                        }
+                    }
+                    voteEventWorkSettingsMapper.updateById(workSettingsDto);
+                    return AjaxResult.success(workSettingsDto.getId());
+                }
+                return AjaxResult.success(workSettingsDto.getId());
+            }
         }
         return AjaxResult.success(workSettingsDto.getId());
-
     }
 
     private void extracted(String existingRoundsIdStr) {
@@ -266,10 +301,28 @@ public class VoteEventWorkSettingsServiceImpl extends ServiceImpl<VoteEventWorkS
     public int deleteWorkSettings(Long id) {
         VoteEventWorkSettings eventWorkSettings = voteEventWorkSettingsMapper.selectById(id);
         if (eventWorkSettings == null) {
-            throw new RuntimeException("暂无作品设置数据");
+            throw new RuntimeException("作品设置数据不存在,ID: " + id);
+        }
+        VoteEvents voteEvents = voteEventsMapper.selectById(eventWorkSettings.getEventId());
+        if (voteEvents.getStatus().equals(commit_shelves)) {
+            throw new RuntimeException("已发布作品,不允许删除");
         }
         this.extracted(eventWorkSettings.getRoundsId());
-        return voteEventWorkSettingsMapper.deleteById(id);
+        // 更新 VoteSubmission 表中的 isDeleted 字段
+        LambdaQueryWrapper<VoteSubmission> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(VoteSubmission::getWorkSettingsId, eventWorkSettings.getId())
+                .eq(VoteSubmission::getEventId, eventWorkSettings.getEventId());
+        VoteSubmission submission = new VoteSubmission();
+        submission.setIsDeleted(IS_DELETED_1);
+        submission.setId(eventWorkSettings.getId());
+        voteSubmissionMapper.updateById(submission);
+
+        int result = voteEventWorkSettingsMapper.deleteById(id);
+        if (result != 1) {
+            throw new RuntimeException("删除作品设置数据失败,ID: " + id);
+        }
+
+        return result;
     }
 
     /**
@@ -379,7 +432,7 @@ public class VoteEventWorkSettingsServiceImpl extends ServiceImpl<VoteEventWorkS
 
     // 批量查询所有评审专家姓名
     private String getJudgesNamesMap(String judgesId, Map<String, String> stringMap) {
-        if (judgesId.isEmpty()){
+        if (judgesId.isEmpty()) {
             return "暂未分配专家";
         }
         Set<String> judgesIdSet = Arrays.stream(judgesId.split(","))

+ 47 - 17
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteEventsServiceImpl.java

@@ -7,22 +7,21 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.vctgo.common.core.exception.ServiceException;
 import com.vctgo.common.core.text.Convert;
 import com.vctgo.common.core.utils.ServletUtils;
+import com.vctgo.common.core.web.domain.AjaxResult;
 import com.vctgo.common.mybatisplus.constant.MybatisPageConstants;
 import com.vote.system.domain.*;
 import com.vote.system.domain.vo.VoteEventsVo;
 import com.vote.system.mapper.*;
 import com.vote.system.service.VoteEventsService;
-import com.vote.system.service.VoteWorkTypesService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.time.LocalDateTime;
-import java.time.ZoneId;
-import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import static com.vote.system.util.ConstantUtils.IS_DELETED_0;
@@ -62,10 +61,23 @@ public class VoteEventsServiceImpl extends ServiceImpl<VoteEventsMapper, VoteEve
      */
     @Override
     public Page<VoteEventsVo> getEventsList(VoteEvents voteEvents) {
+        // 获取分页参数,默认值分别为 1 和 10
         long pageNum = Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_NUM), 1L);
         long pageSize = Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_SIZE), 10L);
+
+        // 验证分页参数是否合法
+        if (pageNum <= 0) {
+            pageNum = 1L;
+        }
+        if (pageSize <= 0 || pageSize > 100) { // 防止过大的页面大小
+            pageSize = 10L;
+        }
+
+        // 创建分页对象
         Page<VoteEvents> page = new Page<>(pageNum, pageSize);
         LambdaQueryWrapper<VoteEvents> wrapper = new LambdaQueryWrapper<>();
+
+        // 构建查询条件
         if (voteEvents != null) {
             if (voteEvents.getKeyword() != null && !voteEvents.getKeyword().isEmpty()) {
                 wrapper.like(VoteEvents::getName, voteEvents.getKeyword());
@@ -74,20 +86,31 @@ public class VoteEventsServiceImpl extends ServiceImpl<VoteEventsMapper, VoteEve
                 wrapper.eq(VoteEvents::getStatus, voteEvents.getStatus());
             }
         }
-        wrapper.eq(VoteEvents::getIsDeleted, IS_DELETED_0)
-                .orderByDesc(VoteEvents::getUpdatedAt);
+
+        wrapper.eq(VoteEvents::getIsDeleted, IS_DELETED_0);
+
+        // 执行分页查询
         IPage<VoteEvents> resultPage = voteEventsMapper.selectPage(page, wrapper);
-        List<VoteEvents> voteEventsList = resultPage.getRecords();
-        List<VoteEventsVo> eventsVos = voteEventsList.stream().map(item -> {
+
+        // 处理查询结果
+        List<VoteEventsVo> eventsVos = resultPage.getRecords().stream().map(item -> {
             VoteEventsVo eventsVo = new VoteEventsVo();
-            eventsVo.setQuantity(voteEventsMapper.queryById(item.getId()));
-            eventsVo.setNumber(voteEventsMapper.queryNumberById(item.getId()));
             BeanUtils.copyProperties(item, eventsVo);
+            // 查询额外信息
+            Integer quantity = voteEventsMapper.queryById(item.getId());
+            Integer number = voteEventsMapper.queryNumberById(item.getId());
+            // 防止空指针异常
+            eventsVo.setQuantity(quantity);
+            if (number != null) {
+                eventsVo.setNumber(number);
+            }
             return eventsVo;
-        }).collect(Collectors.toList());
+        }).sorted(Comparator.comparing(VoteEventsVo::getUpdatedAt).reversed()).collect(Collectors.toList());
+        // 创建分页结果对象
         Page<VoteEventsVo> voPage = new Page<>(pageNum, pageSize);
         voPage.setTotal(resultPage.getTotal());
         voPage.setRecords(eventsVos);
+
         return voPage;
     }
 
@@ -144,11 +167,14 @@ public class VoteEventsServiceImpl extends ServiceImpl<VoteEventsMapper, VoteEve
     }
 
     @Override
-    public boolean changeStatus(Long id, String status) {
-        VoteEvents voteEvents = new VoteEvents();
-        voteEvents.setStatus(status);
-        voteEvents.setId(id);
+    public boolean changeStatus(VoteEvents voteEvents) {
         voteEvents.setUpdatedAt(new Date());
+        // 添加延时一秒的操作
+        try {
+            TimeUnit.SECONDS.sleep(1);
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
         return this.updateById(voteEvents);
     }
 
@@ -160,8 +186,12 @@ public class VoteEventsServiceImpl extends ServiceImpl<VoteEventsMapper, VoteEve
      */
     @Override
     @Transactional
-    public int edit(VoteEvents voteEvents) {
-        return voteEventsMapper.updateById(voteEvents);
+    public AjaxResult edit(VoteEvents voteEvents) {
+        VoteEvents events = voteEventsMapper.selectById(voteEvents.getId());
+        if (events.getStatus().equals(commit_shelves)) {
+            return AjaxResult.error("该活动已发布,无法修改活动信息");
+        }
+        return AjaxResult.success(voteEventsMapper.updateById(voteEvents));
     }
 
 

+ 42 - 11
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteExpertWorkingPlatformServiceImpl.java

@@ -88,6 +88,9 @@ public class VoteExpertWorkingPlatformServiceImpl implements VoteExpertWorkingPl
     private VoteSubmissionItemMapper voteSubmissionItemMapper;
 
     @Autowired
+    private VoteRegistrationsMapper voteRegistrationsMapper;
+
+    @Autowired
     private RemoteFileService remoteFileService;
 
     @Autowired
@@ -207,13 +210,16 @@ public class VoteExpertWorkingPlatformServiceImpl implements VoteExpertWorkingPl
         String userId = JwtUtils.getUserId(token);
         // 查询符合条件的作品列表
         LambdaQueryWrapper<VoteSubmission> submissionWrapper = new LambdaQueryWrapper<>();
-        submissionWrapper.eq(VoteSubmission::getEventId, eventId).eq(VoteSubmission::getWorkSettingsId, workSettingsId).eq(VoteSubmission::getRoundId, roundId);
+        submissionWrapper.eq(VoteSubmission::getEventId, eventId)
+                .eq(VoteSubmission::getWorkSettingsId, workSettingsId)
+                .eq(VoteSubmission::getRoundId, roundId);
         List<VoteSubmission> submissions = voteSubmissionMapper.selectList(submissionWrapper);
         List<Long> validSubmissionIds;
         LambdaQueryWrapper<VoteEvaluationTasks> tasksWrapper = new LambdaQueryWrapper<>();
         tasksWrapper.eq(VoteEvaluationTasks::getJudgeId, userId);
         if ("0".equals(status) || "1".equals(status)) {
             tasksWrapper.eq(VoteEvaluationTasks::getStatus, Integer.parseInt(status)); // 根据 status 过滤 tasks
+            tasksWrapper.eq(VoteEvaluationTasks::getRoundId, roundId);
             validSubmissionIds = voteEvaluationTasksMapper.selectList(tasksWrapper).stream().map(VoteEvaluationTasks::getSubmissionId).collect(Collectors.toList());
         } else if ("2".equals(status)) {
             validSubmissionIds = voteEvaluationTasksMapper.selectList(tasksWrapper).stream().map(VoteEvaluationTasks::getSubmissionId).collect(Collectors.toList());
@@ -227,8 +233,13 @@ public class VoteExpertWorkingPlatformServiceImpl implements VoteExpertWorkingPl
             // 处理评分逻辑
             LambdaQueryWrapper<VoteEventRegistrationWorkScores> queryWrapper = new LambdaQueryWrapper<>();
             queryWrapper.eq(VoteEventRegistrationWorkScores::getSubmissionId, item.getId());
+            queryWrapper.eq(VoteEventRegistrationWorkScores::getRoundId, roundId);
             VoteEventRegistrationWorkScores scores = voteEventRegistrationWorkScoresMapper.selectOne(queryWrapper);
-
+            LambdaQueryWrapper<VoteRegistrations> wrapper = new LambdaQueryWrapper<>();
+            wrapper.eq(VoteRegistrations::getUid, item.getUserId())
+                    .eq(VoteRegistrations::getEventId, item.getEventId());
+            List<VoteRegistrations> voteRegistrations = voteRegistrationsMapper.selectList(wrapper);
+            submissionVo.setBelongRegion(voteRegistrations.get(0).getBelongRegion());
             // 设置评分,如果没有找到对应的记录则评分为 0
             if (scores != null) {
                 submissionVo.setScore(scores.getScore());
@@ -271,7 +282,9 @@ public class VoteExpertWorkingPlatformServiceImpl implements VoteExpertWorkingPl
 
         // 通过 JudgeId 和 submissionIds 进行查询,并按 status 分组
         LambdaQueryWrapper<VoteEvaluationTasks> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(VoteEvaluationTasks::getJudgeId, userId).in(VoteEvaluationTasks::getSubmissionId, submissionIds);
+        queryWrapper.eq(VoteEvaluationTasks::getJudgeId, userId)
+                .eq(VoteEvaluationTasks::getRoundId, roundId)
+                .in(VoteEvaluationTasks::getSubmissionId, submissionIds);
 
         // 查询出所有符合条件的记录,并按 status 分组统计
         Map<Integer, Long> statusCountMap = voteEvaluationTasksMapper.selectList(queryWrapper).stream().collect(Collectors.groupingBy(VoteEvaluationTasks::getStatus, Collectors.counting()));
@@ -302,16 +315,17 @@ public class VoteExpertWorkingPlatformServiceImpl implements VoteExpertWorkingPl
                     .eq(VoteJudgesVisibleFields::getRoundId, roundId);
 
             // 获取可见字段配置
-            VoteJudgesVisibleFields selectOne = voteJudgesVisibleFieldsMapper.selectOne(wrapper);
-            if (selectOne == null) {
+            List<VoteJudgesVisibleFields> voteJudgesVisibleFields = voteJudgesVisibleFieldsMapper.selectList(wrapper);
+            if (voteJudgesVisibleFields == null) {
                 // 如果未找到可见字段配置,记录警告日志并返回null
                 log.warn("未找到可见字段配置,eventId={}, workSettingsId={}, roundId={}", eventId, workSettingsId, roundId);
                 return null;
             }
 
             // 解析可见字段的JSON字符串,确定哪些字段是可见的
-            String visibleFieldsJson = selectOne.getVisibleFields();
+            String visibleFieldsJson = voteJudgesVisibleFields.get(0).getVisibleFields();
             Set<String> visibleFields = parseVisibleFieldsJson(visibleFieldsJson);
+            visibleFields.add("appraise_status"); //添加评选状态字段
 
             // 根据主键从数据库中获取VoteSubmission
             VoteSubmission voteSubmission = voteSubmissionMapper.selectById(submissionId);
@@ -339,7 +353,7 @@ public class VoteExpertWorkingPlatformServiceImpl implements VoteExpertWorkingPl
             for (FileInfo fileInfo : fileInfoList) {
                 VoteFileVo fileVo = new VoteFileVo();
                 fileVo.setFileName(fileInfo.getFileName());
-                fileVo.setFileUrl(fileInfo.getFileUrl()); // 设置文件URL
+                fileVo.setFileUrl(fileInfo.getFilePreviewUrl()); // 设置文件URL
                 // 根据 fileType 来判断文件类型
                 String fileType = fileInfo.getFileType();
                 switch (fileType) {
@@ -380,6 +394,7 @@ public class VoteExpertWorkingPlatformServiceImpl implements VoteExpertWorkingPl
             submission.setImageFiles(imageFiles);
             submission.setDocumentFiles(documentFiles);
             submission.setVideoFiles(videoFiles);
+            submission.setAppraiseStatus(submission.getAppraiseStatus());
             return submission;
         } catch (Exception e) {
             // 捕获任何异常并记录错误日志
@@ -413,7 +428,11 @@ public class VoteExpertWorkingPlatformServiceImpl implements VoteExpertWorkingPl
             VoteExpertWorkingPlatformDto decode = dataEncoder.decode(encode);
             //校验是否重复评分
             LambdaQueryWrapper<VoteEventRegistrationWorkScores> queryWrapper = new LambdaQueryWrapper<>();
-            queryWrapper.eq(VoteEventRegistrationWorkScores::getSubmissionId, decode.getSubmissionId()).eq(VoteEventRegistrationWorkScores::getEventId, decode.getEventId()).eq(VoteEventRegistrationWorkScores::getWorkSettingsId, decode.getWorkSettingsId()).eq(VoteEventRegistrationWorkScores::getJudgeId, userId);
+            queryWrapper.eq(VoteEventRegistrationWorkScores::getSubmissionId, decode.getSubmissionId())
+                    .eq(VoteEventRegistrationWorkScores::getEventId, decode.getEventId())
+                    .eq(VoteEventRegistrationWorkScores::getWorkSettingsId, decode.getWorkSettingsId())
+                    .eq(VoteEventRegistrationWorkScores::getRoundId, decode.getRoundId())
+                    .eq(VoteEventRegistrationWorkScores::getJudgeId, userId);
             List<VoteEventRegistrationWorkScores> scoresList = voteEventRegistrationWorkScoresMapper.selectList(queryWrapper);
             if (!scoresList.isEmpty()) {
                 throw new ServiceException("该作品已经评分,不可重复评分");
@@ -433,19 +452,31 @@ public class VoteExpertWorkingPlatformServiceImpl implements VoteExpertWorkingPl
                     throw new ServiceException("该" + scoringItem.getScoring() + "评分分数必须在 0 到" + score + "之间");
                 }
                 VoteSubmissionItem voteSubmissionItem = new VoteSubmissionItem();
-                voteSubmissionItem.setItemId(item.getItemId()).setScore(item.getScore()).setSubmissionId(item.getSubmissionId());
+                voteSubmissionItem.setItemId(item.getItemId())
+                        .setScore(item.getScore())
+                        .setSubmissionId(item.getSubmissionId())
+                        .setRoundId(decode.getRoundId());
                 totalScore += item.getScore();
                 itemList.add(voteSubmissionItem);
             }
             int i = voteSubmissionItemMapper.insertBatch(itemList);
             if (i > 0) {
+                VoteSubmission submission = new VoteSubmission();
+                submission.setId(decode.getSubmissionId())
+                        .setAppraiseStatus("2");
+                voteSubmissionMapper.updateById(submission);
                 voteEvaluationTasksMapper.updateBySubmissionId(decode.getSubmissionId(), userId);
                 //根据作品id 修改评分表总分
                 LambdaUpdateWrapper<VoteEventRegistrationWorkScores> wrapper = new LambdaUpdateWrapper<>();
                 wrapper.eq(VoteEventRegistrationWorkScores::getSubmissionId, decode.getSubmissionId());
                 List<VoteEventRegistrationWorkScores> workScores = voteEventRegistrationWorkScoresMapper.selectList(wrapper);
                 VoteEventRegistrationWorkScores scores = new VoteEventRegistrationWorkScores();
-                scores.setScore(BigDecimal.valueOf(totalScore)).setEventId(decode.getEventId()).setWorkSettingsId(decode.getWorkSettingsId()).setSubmissionId(decode.getSubmissionId()).setJudgeId(Long.valueOf(decode.getJudgesId()));
+                scores.setScore(BigDecimal.valueOf(totalScore))
+                        .setEventId(decode.getEventId())
+                        .setWorkSettingsId(decode.getWorkSettingsId())
+                        .setSubmissionId(decode.getSubmissionId())
+                        .setJudgeId(Long.valueOf(decode.getJudgesId()))
+                        .setRoundId(decode.getRoundId());
                 if (workScores != null) {
                     return voteEventRegistrationWorkScoresMapper.insert(scores);
                 } else {
@@ -529,7 +560,7 @@ public class VoteExpertWorkingPlatformServiceImpl implements VoteExpertWorkingPl
         // 创建查询条件
         LambdaQueryWrapper<VoteEvents> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.in(VoteEvents::getId, eventIds); // 根据 eventId 查询
-        queryWrapper.eq(VoteEvents::getStatus, "0");
+//        queryWrapper.eq(VoteEvents::getStatus, "0");
         // 执行查询并转换为 Map
         return voteEventsMapper.selectList(queryWrapper).stream().collect(Collectors.toMap(VoteEvents::getId, Function.identity()));
     }

+ 46 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteHistoryScoreServiceImpl.java

@@ -0,0 +1,46 @@
+package com.vote.system.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.vote.system.domain.VoteHistoryScore;
+import com.vote.system.domain.VoteSubmission;
+import com.vote.system.domain.vo.VoteHistoryScoreVo;
+import com.vote.system.mapper.VoteSubmissionMapper;
+import com.vote.system.service.VoteHistoryScoreService;
+import com.vote.system.mapper.VoteHistoryScoreMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Administrator
+ * @description 针对表【vote_history_score】的数据库操作Service实现
+ * @createDate 2024-09-29 18:03:15
+ */
+@Service
+public class VoteHistoryScoreServiceImpl extends ServiceImpl<VoteHistoryScoreMapper, VoteHistoryScore>
+        implements VoteHistoryScoreService {
+
+    @Autowired
+    private VoteHistoryScoreMapper voteHistoryScoreMapper;
+
+    @Autowired
+    private VoteSubmissionMapper voteSubmissionMapper;
+
+    @Override
+    public VoteHistoryScoreVo getHistoryScore(Long submissionId) {
+        VoteSubmission submission = voteSubmissionMapper.selectById(submissionId);
+        VoteHistoryScoreVo historyScoreVo = new VoteHistoryScoreVo();
+        historyScoreVo.setSubmissionName(submission.getName());
+        LambdaQueryWrapper<VoteHistoryScore> wrapper = new LambdaQueryWrapper<>();
+        wrapper.in(VoteHistoryScore::getSubmissionId, submissionId);
+        historyScoreVo.setVoteHistoryScores(voteHistoryScoreMapper.selectList(wrapper));
+        return historyScoreVo;
+    }
+}
+
+
+
+

+ 15 - 2
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteJudgesVisibleFieldsServiceImpl.java

@@ -1,6 +1,7 @@
 package com.vote.system.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.vote.system.domain.VoteEventWorkSettings;
@@ -46,6 +47,17 @@ public class VoteJudgesVisibleFieldsServiceImpl extends ServiceImpl<VoteJudgesVi
         return Collections.emptyList();
     }
 
+    @Override
+    public int addVoteJudgesVisibleFields(VoteJudgesVisibleFields voteJudgesVisibleFields) {
+        List<String> visibleFields = Arrays.asList(voteJudgesVisibleFields.getVisibleFields().split(","));
+        try {
+            String json = new ObjectMapper().writeValueAsString(visibleFields);
+            voteJudgesVisibleFields.setVisibleFields(json);
+            return this.baseMapper.insert(voteJudgesVisibleFields);
+        } catch (JsonProcessingException e) {
+            throw new RuntimeException(e);
+        }
+    }
 
 
     // 提取 vModel 和 label 字段信息的逻辑
@@ -56,9 +68,10 @@ public class VoteJudgesVisibleFieldsServiceImpl extends ServiceImpl<VoteJudgesVi
 
         try {
             // 解析 JSON 数据
-            formDataList = objectMapper.readValue(formData, new TypeReference<List<Map<String, Object>>>() {});
+            formDataList = objectMapper.readValue(formData, new TypeReference<List<Map<String, Object>>>() {
+            });
 
-                // 遍历列表,提取 vModel 和 label 字段
+            // 遍历列表,提取 vModel 和 label 字段
             for (Map<String, Object> field : formDataList) {
                 Map<String, String> fieldInfo = new HashMap<>();
                 if (field.containsKey("vModel")) {

+ 47 - 0
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteLocationServiceImpl.java

@@ -0,0 +1,47 @@
+package com.vote.system.service.impl;
+
+import com.vctgo.system.api.RemoteBranchKindergartenService;
+import com.vctgo.system.api.RemoteSysProvinceService;
+import com.vctgo.system.api.domain.dto.SysBranchKindergartenDto;
+import com.vote.system.domain.pojo.VoteLocationVo;
+import com.vote.system.service.VoteLocationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @CreateTime: 2024/9/24 下午5:30
+ * @Description:
+ * @Email: f2965573933@163.com
+ * @Author: FanJiaBao
+ */
+@Service
+public class VoteLocationServiceImpl implements VoteLocationService {
+
+    @Autowired
+    private RemoteBranchKindergartenService remoteBranchKindergartenService;
+
+
+    @Override
+    public List<VoteLocationVo> getLocationName(String districtId) {
+        List<SysBranchKindergartenDto> data = remoteBranchKindergartenService.get(null, null, districtId).getData();
+        List<VoteLocationVo> locationVos = new ArrayList<>();
+
+        if (data != null) {
+            locationVos = data.stream()
+                    .filter(datum -> datum != null && datum.getKindergartenName() != null)
+                    .map(datum -> {
+                        VoteLocationVo voteLocationVo = new VoteLocationVo();
+                        voteLocationVo.setId(datum.getId());
+                        voteLocationVo.setLocationName(datum.getKindergartenName());
+                        return voteLocationVo;
+                    })
+                    .collect(Collectors.toList());
+        }
+        return locationVos;
+    }
+}

+ 15 - 1
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteOrganizersServiceImpl.java

@@ -35,15 +35,29 @@ public class VoteOrganizersServiceImpl extends ServiceImpl<VoteOrganizersMapper,
 
     /**
      * 添加主办方
+     *
      * @param voteOrganizers
      * @return
      */
     @Override
     @Transactional
     public int addOrganizers(VoteOrganizers voteOrganizers) {
-        //添加
+        // 检查name是否唯一
+        if (voteOrganizersMapper.existsByName(voteOrganizers.getName())) {
+            throw new IllegalArgumentException("主办方已存在");
+        }
+        // 添加
         return voteOrganizersMapper.insert(voteOrganizers);
     }
+
+    @Override
+    public int edit(VoteOrganizers voteOrganizers) {
+        // 检查name是否唯一
+        if (voteOrganizersMapper.existsByName(voteOrganizers.getName())) {
+            throw new IllegalArgumentException("主办方已存在");
+        }
+        return voteOrganizersMapper.updateById(voteOrganizers);
+    }
 }
 
 

+ 62 - 5
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteRegistrationsServiceImpl.java

@@ -62,8 +62,8 @@ public class VoteRegistrationsServiceImpl extends ServiceImpl<VoteRegistrationsM
         }
         // 构建查询条件
         queryWrapper.eq(VoteRegistrations::getEventId, voteRegistrationsDto.getEventId());
-        if (voteRegistrationsDto.getKeyword() != null) {
-            queryWrapper.like(VoteRegistrations::getName, voteRegistrationsDto.getKeyword());
+        if (voteRegistrationsDto.getName() != null) {
+            queryWrapper.like(VoteRegistrations::getName, voteRegistrationsDto.getName());
         }
         if (voteRegistrationsDto.getProvinceId() != null) {
             queryWrapper.eq(VoteRegistrations::getProvinceId, voteRegistrationsDto.getProvinceId());
@@ -81,6 +81,9 @@ public class VoteRegistrationsServiceImpl extends ServiceImpl<VoteRegistrationsM
         if (voteRegistrationsDto.getStatus() != null) {
             queryWrapper.eq(VoteRegistrations::getStatus, voteRegistrationsDto.getStatus());
         }
+        if (voteRegistrationsDto.getPhone() != null) {
+            queryWrapper.eq(VoteRegistrations::getPhone, voteRegistrationsDto.getPhone());
+        }
         queryWrapper.orderByDesc(VoteRegistrations::getCreatedAt);
 
         // 执行查询并分页
@@ -115,7 +118,10 @@ public class VoteRegistrationsServiceImpl extends ServiceImpl<VoteRegistrationsM
     @Transactional
     public int editStatus(VoteRegistrations voteRegistrations) {
         if (voteRegistrations != null && voteRegistrations.getId() != null) {
-            return voteRegistrationsMapper.updateById(voteRegistrations);
+            VoteRegistrations registrations = new VoteRegistrations();
+            registrations.setId(voteRegistrations.getId());
+            registrations.setStatus(voteRegistrations.getStatus());
+            return voteRegistrationsMapper.updateById(registrations);
         }
         throw new RuntimeException("操作失败");
     }
@@ -136,9 +142,25 @@ public class VoteRegistrationsServiceImpl extends ServiceImpl<VoteRegistrationsM
                         .setPhone(voteRegistrations.getPhone())
                         .setStatus(voteRegistrations.getStatus())
                         .setSex(voteRegistrations.getSex())
-                        .setPost(voteRegistrations.getPost())
-                        .setProfessional(voteRegistrations.getProfessional())
                         .setCertificateNumber(voteRegistrations.getCertificateNumber());
+                String post = voteRegistrations.getPost();
+                if (post != null && !post.isEmpty()) {
+                    String postStr = Arrays.stream(post.split(","))
+                            .map(this::mapPostValue)
+                            .collect(Collectors.joining(","));
+                    vo.setPost(postStr);
+                } else {
+                    vo.setPost("暂未设置岗位");
+                }
+                String professional = voteRegistrations.getProfessional();
+                if (professional != null && !professional.isEmpty()) {
+                    String professionalStr = Arrays.stream(professional.split(","))
+                            .map(this::mapProfessionalValue)
+                            .collect(Collectors.joining(","));
+                    vo.setProfessional(professionalStr);
+                } else {
+                    vo.setProfessional("暂未设置职称");
+                }
                 String ifBackbone = BACKBONE_FLAG.equals(voteRegistrations.getIfBackbone()) ? BACKBONE_YES : BACKBONE_NO;
                 vo.setIfBackbone(ifBackbone);
                 return vo;
@@ -174,6 +196,41 @@ public class VoteRegistrationsServiceImpl extends ServiceImpl<VoteRegistrationsM
         }
     }
 
+
+    //岗位映射到对应的值
+    private String mapPostValue(String value) {
+        switch (value) {
+            case "0":
+                return "园长";
+            case "1":
+                return "主班老师";
+            case "2":
+                return "配班老师";
+            default:
+                return "未知岗位"; // 处理未匹配的值
+        }
+    }
+
+    //职称映射到对应的值
+    private String mapProfessionalValue(String value) {
+        switch (value) {
+            case "0":
+                return "高级教师";
+            case "1":
+                return "副高级教师";
+            case "2":
+                return "一级教师";
+            case "3":
+                return "二级教师";
+            case "4":
+                return "三级教师";
+            case "5":
+                return "其他";
+            default:
+                return "未知职称"; // 处理未匹配的值
+        }
+    }
+
     //获取园所名称
     private SysBranchKindergartenDto getSysBranchKindergartenDto(VoteRegistrations item) {
         return remoteBranchKindergartenService.getById(item.getLocationId()).getData();

+ 3 - 2
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteRuleServiceImpl.java

@@ -9,6 +9,7 @@ import com.vctgo.common.core.utils.ServletUtils;
 import com.vctgo.common.mybatisplus.constant.MybatisPageConstants;
 import com.vote.system.domain.VoteRule;
 import com.vote.system.domain.VoteScoringItem;
+import com.vote.system.domain.VoteSubmissionForm;
 import com.vote.system.domain.dto.VoteScoringItemDto;
 import com.vote.system.mapper.VoteRuleMapper;
 import com.vote.system.mapper.VoteScoringItemMapper;
@@ -119,10 +120,10 @@ public class VoteRuleServiceImpl extends ServiceImpl<VoteRuleMapper, VoteRule>
     private void extracted(VoteRule voteRule) {
         LambdaQueryWrapper<VoteRule> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(VoteRule::getName, voteRule.getName().trim());
+        wrapper.ne(VoteRule::getRuleId, voteRule.getRuleId());
         List<VoteRule> voteRules = voteRuleMapper.selectList(wrapper);
-        if (voteRules.size() > 0) {
+        if (!voteRules.isEmpty()) {
             throw new RuntimeException("存在重复规则表单,添加失败");
-
         }
     }
 

+ 11 - 7
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteScoringItemServiceImpl.java

@@ -84,20 +84,24 @@ public class VoteScoringItemServiceImpl extends ServiceImpl<VoteScoringItemMappe
     @Override
     @Transactional
     public Integer saveVoteScoringItem(VoteScoringItemDto voteScoringItemDto) {
-        //先删除 在更新
+        // 先删除在更新
         LambdaQueryWrapper<VoteScoringItem> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(VoteScoringItem::getRuleId, voteScoringItemDto.getRuleId());
         voteScoringItemMapper.delete(wrapper);
         insertVoteScoringItems(voteScoringItemDto.getItems(), voteScoringItemDto.getRuleId());
-        //改名字
+        // 检查是否存在重复名称
         LambdaQueryWrapper<VoteRule> queryWrapper = new LambdaQueryWrapper<>();
-        if (voteScoringItemDto.getName() != null) {
-            queryWrapper.eq(VoteRule::getRuleId, voteScoringItemDto.getRuleId());
+        queryWrapper.eq(VoteRule::getName, voteScoringItemDto.getName()); // 查找相同名称的规则
+        List<VoteRule> existingRules = voteRuleMapper.selectList(queryWrapper);
+        // 如果存在且不是当前规则,则抛出异常
+        if (existingRules.stream().anyMatch(rule -> !rule.getRuleId().equals(voteScoringItemDto.getRuleId()))) {
+            throw new ServiceException("修改失败,存在重复表单名: " + voteScoringItemDto.getName());
         }
+        // 修改名称
+        queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(VoteRule::getRuleId, voteScoringItemDto.getRuleId());
         VoteRule voteRule = voteRuleMapper.selectOne(queryWrapper);
-        if (voteRule.getName().equals(voteScoringItemDto.getName())) {
-            throw new ServiceException("修改失败存在重复表单名" + voteScoringItemDto.getName());
-        }
+
         voteRule.setName(voteScoringItemDto.getName());
         return voteRuleMapper.updateById(voteRule);
     }

+ 1 - 1
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteSubmissionFormServiceImpl.java

@@ -134,10 +134,10 @@ public class VoteSubmissionFormServiceImpl extends ServiceImpl<VoteSubmissionFor
                 maps.add(map);
             }
         }
-
         // 检查数据库中是否存在重复的作品表单
         LambdaQueryWrapper<VoteSubmissionForm> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(VoteSubmissionForm::getFormName, voteSubmissionForm.getFormName().trim());
+        wrapper.ne(VoteSubmissionForm::getId, voteSubmissionForm.getId());
         List<VoteSubmissionForm> submissionForms = voteSubmissionFormMapper.selectList(wrapper);
         if (!submissionForms.isEmpty()) {
             throw new RuntimeException("存在重复作品表单,添加失败");

+ 199 - 91
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteSubmissionServiceImpl.java

@@ -4,14 +4,17 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.vctgo.common.core.exception.ServiceException;
 import com.vctgo.common.core.text.Convert;
 import com.vctgo.common.core.utils.ServletUtils;
 import com.vctgo.common.mybatisplus.constant.MybatisPageConstants;
 import com.vctgo.system.api.RemoteBranchKindergartenService;
 import com.vctgo.system.api.RemoteFileService;
 import com.vctgo.system.api.RemotePlatformUserService;
+import com.vctgo.system.api.RemoteUserService;
 import com.vctgo.system.api.domain.FileInfo;
 import com.vctgo.system.api.domain.SysPlatformUser;
+import com.vctgo.system.api.domain.SysUser;
 import com.vctgo.system.api.domain.dto.SysBranchKindergartenDto;
 import com.vctgo.system.api.domain.vo.VoteFileVo;
 import com.vote.system.domain.*;
@@ -65,9 +68,6 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
     private VoteRegistrationsMapper voteRegistrationsMapper;
 
     @Autowired
-    private VoteRuleMapper voteRuleMapper;
-
-    @Autowired
     private VoteScoringItemMapper voteScoringItemMapper;
 
     @Autowired
@@ -86,6 +86,9 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
     @Autowired
     private VoteEventRegistrationWorkScoresMapper voteEventRegistrationWorkScoresMapper;
 
+    @Autowired
+    private VoteHistoryScoreMapper voteHistoryScoreMapper;
+
 
     /**
      * 分页查询 参赛作品列表
@@ -108,16 +111,18 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
         //获取工作类型数据
         Map<Long, VoteEventWorkSettings> workSettingsMap = voteEventWorkSettingsMapper.selectList(new LambdaQueryWrapper<>())
                 .stream().collect(Collectors.toMap(VoteEventWorkSettings::getId, Function.identity()));
-
         // 构建返回的VO列表
         List<VoteSubmissionVo> voList = voteSubmissions.stream()
                 .map(item -> {
                     VoteSubmissionVo vo = new VoteSubmissionVo();
                     vo.setId(item.getId());
                     vo.setName(item.getName());
-                    vo.setCommitName(item.getCommitName());
+                    LambdaQueryWrapper<VoteRegistrations> wrapper = new LambdaQueryWrapper<>();
+                    wrapper.eq(VoteRegistrations::getUid, item.getUserId()).eq(VoteRegistrations::getEventId, item.getEventId());
+                    List<VoteRegistrations> registrations = voteRegistrationsMapper.selectList(wrapper);
+                    vo.setCommitName(registrations.get(0).getName());
                     vo.setCommitTime(item.getCreateAt());
-                    vo.setPhone(item.getPhone());
+                    vo.setPhone(registrations.get(0).getPhone());
                     vo.setStatus(item.getStatus());
                     //设置类型名称
                     VoteEventWorkSettings workSettings = workSettingsMap.get(item.getWorkSettingsId());
@@ -142,6 +147,7 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
     private List<VoteSubmission> getVoteSubmissions(VoteSubmissionDto voteSubmissionDto) {
         List<Long> userIds = new ArrayList<>();
         boolean locationFilterApplied = false;
+        boolean keywordFilterApplied = false; // 新增标志
         LambdaQueryWrapper<VoteRegistrations> queryWrapper = new LambdaQueryWrapper<>();
         if (voteSubmissionDto.getProvinceId() != null) {
             queryWrapper.eq(VoteRegistrations::getProvinceId, voteSubmissionDto.getProvinceId());
@@ -158,19 +164,13 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
                     .map(VoteRegistrations::getUid)
                     .collect(Collectors.toList());
             locationFilterApplied = true;
-
-            if (userIds.isEmpty()) {
-                return new ArrayList<>();
-            }
         }
-
         LambdaQueryWrapper<VoteSubmission> wrapper = new LambdaQueryWrapper<>();
         if (voteSubmissionDto.getEventId() == null) {
             throw new RuntimeException("活动id为空 暂时无法查询");
         } else {
             wrapper.eq(VoteSubmission::getEventId, voteSubmissionDto.getEventId());
         }
-
         if (voteSubmissionDto.getWorkSettingsId() != null) {
             wrapper.eq(VoteSubmission::getWorkSettingsId, voteSubmissionDto.getWorkSettingsId());
         }
@@ -180,10 +180,21 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
         if (voteSubmissionDto.getStatus() != null) {
             wrapper.eq(VoteSubmission::getStatus, voteSubmissionDto.getStatus());
         }
+        // 修改关键词查询逻辑
         if (voteSubmissionDto.getKeyword() != null) {
-            wrapper.like(VoteSubmission::getName, voteSubmissionDto.getKeyword())
+            LambdaQueryWrapper<VoteRegistrations> registrationsWrapper = new LambdaQueryWrapper<>();
+            registrationsWrapper.like(VoteRegistrations::getName, voteSubmissionDto.getKeyword())
                     .or()
-                    .like(VoteSubmission::getPhone, voteSubmissionDto.getKeyword());
+                    .like(VoteRegistrations::getPhone, voteSubmissionDto.getKeyword());
+
+            List<Long> filteredUserIds = voteRegistrationsMapper.selectList(registrationsWrapper).stream()
+                    .map(VoteRegistrations::getUid)
+                    .collect(Collectors.toList());
+
+            if (!filteredUserIds.isEmpty()) {
+                wrapper.in(VoteSubmission::getUserId, filteredUserIds);
+                keywordFilterApplied = true; // 标记关键词过滤已应用
+            }
         }
         if (voteSubmissionDto.getRoundId() != null) {
             wrapper.eq(VoteSubmission::getRoundId, voteSubmissionDto.getRoundId());
@@ -195,7 +206,13 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
             wrapper.eq(VoteSubmission::getPromoteStatus, voteSubmissionDto.getPromoteStatus());
         }
         wrapper.orderByDesc(VoteSubmission::getCreateAt);
-        return voteSubmissionMapper.selectList(wrapper);
+        // 执行查询
+        List<VoteSubmission> submissions = voteSubmissionMapper.selectList(wrapper);
+        // 如果查询结果为空且没有其他条件,返回空列表
+        if (submissions.isEmpty() && !locationFilterApplied && !keywordFilterApplied) {
+            return new ArrayList<>();
+        }
+        return submissions;
     }
 
 
@@ -208,48 +225,61 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
     @Override
     public VoteSubmissionVo selectById(Long id) {
         VoteSubmission submission = voteSubmissionMapper.selectById(id);
+        if (submission == null) {
+            throw new NoSuchElementException("VoteSubmission not found with id: " + id);
+        }
+
         VoteSubmissionVo vo = new VoteSubmissionVo();
-        submission.setFile(submission.getFile() + "," + submission.getImages() + "," + submission.getVideo());
-        List<FileInfo> fileInfoList = remoteFileService.selectUrlByIds(submission.getFile()).getData();//文件集合
-        // 初始化图片 URL 列表
-        List<VoteFileVo> imageFiles = new ArrayList<>();
-        List<VoteFileVo> videoFiles = new ArrayList<>();
-        List<VoteFileVo> documentFiles = new ArrayList<>();
-        for (FileInfo fileInfo : fileInfoList) {
-            VoteFileVo fileVo = new VoteFileVo();
-            fileVo.setFileUrl(fileInfo.getFileUrl()); // 设置文件URL
-            fileVo.setFileName(fileInfo.getFileName());
-            // 根据 fileType 来判断文件类型
-            String fileType = fileInfo.getFileType();
-            switch (fileType) {
-                case "1":  // 文件
-                    documentFiles.add(fileVo);
-                    break;
-                case "2":  // 图片类型
-                    imageFiles.add(fileVo);
-                    break;
-                case "3":  // 视频类型
-                    videoFiles.add(fileVo);
-                    break;
-                default:
-                    break;
+        String string = submission.getFile() + "," + submission.getImages() + "," + submission.getVideo();
+        List<FileInfo> fileInfoList = remoteFileService.selectUrlByIds(string).getData();
+        // 检查 fileInfoList 是否为 null 或者为空
+        if (fileInfoList == null || fileInfoList.isEmpty()) {
+            // 如果 fileInfoList 为空,可以设置一些默认值或记录日志
+            vo.setVideoFiles(Collections.emptyList());
+            vo.setDocumentFiles(Collections.emptyList());
+            vo.setImageFiles(Collections.emptyList());
+        } else {
+            // 初始化图片 URL 列表
+            List<VoteFileVo> imageFiles = new ArrayList<>();
+            List<VoteFileVo> videoFiles = new ArrayList<>();
+            List<VoteFileVo> documentFiles = new ArrayList<>();
+            for (FileInfo fileInfo : fileInfoList) {
+                VoteFileVo fileVo = new VoteFileVo();
+                fileVo.setFileUrl(fileInfo.getFilePreviewUrl()); // 设置文件预览URL
+                fileVo.setFileName(fileInfo.getFileStorageName());
+
+                switch (fileInfo.getFileType()) {
+                    case "1":  // 文件
+                        documentFiles.add(fileVo);
+                        break;
+                    case "2":  // 图片类型
+                        imageFiles.add(fileVo);
+                        break;
+                    case "3":  // 视频类型
+                        videoFiles.add(fileVo);
+                        break;
+                    default:
+                        break;
+                }
             }
+
+            vo.setVideoFiles(videoFiles)
+                    .setDocumentFiles(documentFiles)
+                    .setImageFiles(imageFiles);
         }
-        vo.setVideoFiles(videoFiles)
-                .setDocumentFiles(documentFiles)
-                .setImageFiles(imageFiles);
         vo.setName(submission.getName())
                 .setMainAuthor(submission.getMainAuthor())
                 .setTeamWorker(submission.getTeamWorker());
+
         if (CREATE_TYPE_PERSONAL.equals(submission.getCreateType())) {
             vo.setCreateType(CREATE_TYPE_PERSONAL_DESC);
         } else {
             vo.setCreateType(CREATE_TYPE_TEAM_DESC);
         }
-        if (!submission.getAgeSegment().isEmpty()) {
+
+        if (submission.getAgeSegment() != null && !submission.getAgeSegment().isEmpty()) {
             StringBuilder builder = new StringBuilder();
-            String ageSegment = submission.getAgeSegment();
-            String[] split = ageSegment.split(",");
+            String[] split = submission.getAgeSegment().split(",");
             for (String s : split) {
                 if (s.equals(ZHONG_BAN_CODE)) {
                     builder.append(ZHONG_BAN_DESC);
@@ -260,7 +290,10 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
                 }
             }
             vo.setAgeSegment(builder.toString());
+        } else {
+            vo.setAgeSegment("");
         }
+
         return vo;
     }
 
@@ -275,83 +308,99 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
 
         // 获取作品列表和专家数据
         List<VoteSubmission> voteSubmissions = getVoteSubmissions(voteSubmissionDto);
+        if (voteSubmissions == null) {
+            voteSubmissions = Collections.emptyList(); // 防止空指针
+        }
+
         // 将专家列表转换为以judgeId为键,专家姓名为值的Map
-        Map<String, String> judgeMap = remotePlatformUserService.processExpertList().getData().stream()
+        Map<String, String> judgeMap = Optional.ofNullable(remotePlatformUserService.processExpertList().getData())
+                .orElse(Collections.emptyList()).stream()
                 .collect(Collectors.toMap(
                         user -> user.getUserId().toString(),
                         SysPlatformUser::getNickName
                 ));
+
         // 预先生成 submissionId 到 judgeId 的映射
-        Map<Long, String> submissionJudgeMap = voteSubmissions.stream()
-                .collect(Collectors.toMap(
-                        VoteSubmission::getId,
-                        submission -> voteEvaluationTasksMapper.selectOne(
-                                new LambdaQueryWrapper<VoteEvaluationTasks>()
-                                        .eq(VoteEvaluationTasks::getSubmissionId, submission.getId())
-                        ).getJudgeId()
-                ));
+        Map<Long, String> submissionJudgeMap = new HashMap<>();
+        for (VoteSubmission submission : voteSubmissions) {
+            String judgeId = Optional.ofNullable(voteEvaluationTasksMapper.selectOne(
+                    new LambdaQueryWrapper<VoteEvaluationTasks>()
+                            .eq(VoteEvaluationTasks::getSubmissionId, submission.getId())
+                            .eq(VoteEvaluationTasks::getRoundId, submission.getRoundId())
+            )).map(VoteEvaluationTasks::getJudgeId).orElse(null);
+            submissionJudgeMap.put(submission.getId(), judgeId);
+        }
+
+
         // 预先生成 submissionId 到 score 的映射
-        Map<Long, BigDecimal> submissionScoreMap = voteSubmissions.stream()
-                .collect(Collectors.toMap(
-                        VoteSubmission::getId,
-                        submission -> {
-                            try {
-                                VoteEventRegistrationWorkScores score = voteEventRegistrationWorkScoresMapper.selectOne(
-                                        new LambdaQueryWrapper<VoteEventRegistrationWorkScores>()
-                                                .eq(VoteEventRegistrationWorkScores::getEventId, submission.getEventId())
-                                                .eq(VoteEventRegistrationWorkScores::getWorkSettingsId, submission.getWorkSettingsId())
-                                                .eq(VoteEventRegistrationWorkScores::getSubmissionId, submission.getId())
-                                );
-                                return (score != null) ? score.getScore() : BigDecimal.ZERO;
-                            } catch (Exception e) {
-                                return BigDecimal.ZERO;
-                            }
-                        }
-                ));
+        Map<Long, BigDecimal> submissionScoreMap = new HashMap<>();
+        for (VoteSubmission submission : voteSubmissions) {
+            BigDecimal score = BigDecimal.ZERO;
+            try {
+                VoteEventRegistrationWorkScores workScore = voteEventRegistrationWorkScoresMapper.selectOne(
+                        new LambdaQueryWrapper<VoteEventRegistrationWorkScores>()
+                                .eq(VoteEventRegistrationWorkScores::getEventId, submission.getEventId())
+                                .eq(VoteEventRegistrationWorkScores::getWorkSettingsId, submission.getWorkSettingsId())
+                                .eq(VoteEventRegistrationWorkScores::getRoundId, submission.getRoundId())
+                                .eq(VoteEventRegistrationWorkScores::getSubmissionId, submission.getId())
+                );
+                score = (workScore != null && workScore.getScore() != null) ? workScore.getScore() : BigDecimal.ZERO;
+            } catch (Exception e) {
+                // 处理异常,记录日志或进行其他处理
+            }
+            submissionScoreMap.put(submission.getId(), score);
+        }
 
         // 将VoteSubmission转换为VoteSubmissionVo
         List<VoteSubmissionVo> vos = voteSubmissions.stream()
                 .map(submission -> {
                     VoteSubmissionVo vo = new VoteSubmissionVo();
                     vo.setName(submission.getName())
-                            .setCommitName(submission.getCommitName())
-                            .setPhone(submission.getPhone())
                             .setId(submission.getId());
+                    LambdaQueryWrapper<VoteRegistrations> wrapper = new LambdaQueryWrapper<>();
+                    wrapper.eq(VoteRegistrations::getUid, submission.getUserId()).eq(VoteRegistrations::getEventId, submission.getEventId());
+                    List<VoteRegistrations> registrations = voteRegistrationsMapper.selectList(wrapper);
+                    vo.setCommitName(registrations.get(0).getName());
+                    vo.setPhone(registrations.get(0).getPhone());
+
+                    VoteEventWorkSettings eventWorkSettings = voteEventWorkSettingsMapper.selectById(submission.getWorkSettingsId());
+                    vo.setWorkTypeName(eventWorkSettings.getAlias());
+
                     // 根据PromoteStatus设置状态
-                    switch (submission.getPromoteStatus()) {
-                        case PENDING_1:
-                            vo.setPromoteStatus(PENDING_1);
-                            break;
-                        case PROMOTE_0:
-                            vo.setPromoteStatus(PROMOTE_0);
-                            break;
-                        default:
-                            vo.setPromoteStatus(UNKNOWN);
-                    }
-                    if (submission.getAward() != null && submission.getAward().isEmpty()) {
+                    vo.setPromoteStatus(Optional.ofNullable(submission.getPromoteStatus()).orElse(UNKNOWN));
+
+                    if (submission.getAward() != null && !submission.getAward().isEmpty()) {
                         vo.setAward(submission.getAward());
                     } else {
                         vo.setAward(PENDING);
                     }
                     // 设置园所名称
                     SysBranchKindergartenDto data = getSysBranchKindergartenDto(submission);
-                    vo.setLocationName(data.getKindergartenName());
+                    vo.setLocationName(data != null ? data.getKindergartenName() : null);
+
                     // 从映射表中获取并设置专家姓名
                     vo.setJudge(judgeMap.get(submissionJudgeMap.get(submission.getId())));
+
                     // 从映射表中获取并设置分数
                     vo.setScore(submissionScoreMap.get(submission.getId()));
                     return vo;
                 })
-                .sorted(Comparator.comparing(VoteSubmissionVo::getScore).reversed()) // 按分数降序排序
+                .sorted(Comparator.comparing(VoteSubmissionVo::getScore, Comparator.nullsLast(Comparator.reverseOrder()))) // 按分数降序排序
                 .collect(Collectors.toList());
+
         // 为每个项目分配排序序号
         for (int i = 0; i < vos.size(); i++) {
             vos.get(i).setSort(i + 1);
         }
         // 进行分页
         Page<VoteSubmissionVo> page = new Page<>(pageNum, pageSize);
-        page.setRecords(vos.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()));
+        List<VoteSubmissionVo> paginatedRecords = vos.stream()
+                .skip((pageNum - 1) * pageSize)
+                .limit(pageSize)
+                .collect(Collectors.toList());
+        page.setRecords(paginatedRecords);
         page.setTotal(vos.size());
+
         return page;
     }
 
@@ -376,21 +425,58 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
     @Override
     @Transactional
     public int promote(VoteSubmissionDto voteSubmissionDto) {
+        VoteSubmission submission = voteSubmissionMapper.selectById(voteSubmissionDto.getId());
+        if (submission.getPromoteStatus().equals(PROMOTE_0)) {
+            throw new ServiceException("已晋级的作品不能继续晋级");
+        }
         VoteEventWorkSettings eventWorkSettings = voteEventWorkSettingsMapper.selectById(voteSubmissionDto.getWorkSettingsId());
         String[] split = eventWorkSettings.getRoundsId().split(",");
         List<Long> roundIds = Arrays.stream(split).map(Long::parseLong).collect(Collectors.toList());
         //创建修改对象
         VoteSubmission voteSubmission = new VoteSubmission();
         voteSubmission.setId(voteSubmissionDto.getId())
-                .setPromoteStatus(PROMOTE_0);
+                .setPromoteStatus(PROMOTE_0)
+                .setAppraiseStatus("1");
+
+        //创建历史评分记录
+        VoteHistoryScore historyScore = new VoteHistoryScore();
         if (roundIds.size() > 1) {
             int currentIndex = roundIds.indexOf(voteSubmissionDto.getRoundId());
             if (currentIndex >= 0 && currentIndex < roundIds.size() - 1) {
                 //获取当前索引的后一个元素
                 Long nextRoundId = roundIds.get(currentIndex + 1);
                 voteSubmission.setRoundId(nextRoundId);
+                voteSubmission.setPromoteStatus(PENDING_1);
+                historyScore.setRoundId(nextRoundId);
             }
         }
+        VoteEventEvaluationRounds rounds = voteEventEvaluationRoundsMapper.selectById(submission.getRoundId());
+        Integer number = rounds.getRoundNumber();
+        Object type = rounds.getType();
+        if (type.equals("evaluation")) {
+            type = "评选轮";
+        } else {
+            type = "评奖论";
+        }
+        historyScore.setAlternately("第" + number + "轮" + "(" + type + ")");
+        LambdaQueryWrapper<VoteEventRegistrationWorkScores> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(VoteEventRegistrationWorkScores::getSubmissionId, submission.getId())
+                .eq(VoteEventRegistrationWorkScores::getEventId, submission.getEventId())
+                .eq(VoteEventRegistrationWorkScores::getRoundId, submission.getRoundId());
+        VoteEventRegistrationWorkScores scores = voteEventRegistrationWorkScoresMapper.selectOne(queryWrapper);
+        if (scores == null) {
+            historyScore.setScore("暂未评分");
+        } else {
+            historyScore.setScore(scores.getScore().toString());
+        }
+        historyScore.setSubmissionId(submission.getId());
+        if (rounds.getType().equals("evaluation")) {
+            historyScore.setResult(PROMOTE);
+        } else {
+            historyScore.setResult(submission.getAward());
+        }
+        historyScore.setRoundId(voteSubmissionDto.getRoundId());
+        voteHistoryScoreMapper.insert(historyScore);
         return voteSubmissionMapper.updateById(voteSubmission);
     }
 
@@ -449,6 +535,15 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
         VoteSubmission voteSubmission = new VoteSubmission();
         voteSubmission.setId(voteSubmissionDto.getId())
                 .setAward(voteSubmissionDto.getAward());
+        VoteSubmission submission = voteSubmissionMapper.selectById(voteSubmissionDto.getId());
+        VoteHistoryScore historyScore = new VoteHistoryScore();
+        historyScore.setSubmissionId(voteSubmissionDto.getId())
+                .setRoundId(submission.getRoundId())
+                .setResult(voteSubmissionDto.getAward());
+        LambdaQueryWrapper<VoteHistoryScore> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(VoteHistoryScore::getSubmissionId, voteSubmissionDto.getId())
+                .eq(VoteHistoryScore::getRoundId, submission.getRoundId());
+        voteHistoryScoreMapper.update(historyScore, wrapper);
         return voteSubmissionMapper.updateById(voteSubmission);
     }
 
@@ -467,7 +562,8 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
         for (VoteSubmissionItem submissionItem : submissionItems) {
             VoteScoringItem scoringItem = voteScoringItemMapper.selectById(submissionItem.getItemId());
             scoringItem.setAggregate(submissionItem.getScore());
-            scoringItem.setItemId(submissionItem.getId());
+            scoringItem.setId(submissionItem.getId());
+            scoringItem.setItemId(submissionItem.getItemId());
             items.add(scoringItem);
             totalScore += submissionItem.getScore();
         }
@@ -489,8 +585,7 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
         List<VoteScoringItem> itemList = voteSubmissionDto.getItemList();
         for (VoteScoringItem voteScoringItem : itemList) {
             VoteSubmissionItem voteSubmissionItem = new VoteSubmissionItem();
-            voteSubmissionItem.setSubmissionId(voteSubmissionDto.getId())
-                    .setId(voteScoringItem.getItemId())
+            voteSubmissionItem.setId(voteScoringItem.getId())
                     .setScore(voteScoringItem.getAggregate());
             voteSubmissionItemMapper.updateById(voteSubmissionItem);
         }
@@ -509,6 +604,19 @@ public class VoteSubmissionServiceImpl extends ServiceImpl<VoteSubmissionMapper,
 
     }
 
+    /**
+     * 评奖晋级
+     */
+    @Override
+    public int promoteAward(VoteSubmissionDto voteSubmissionDto) {
+        VoteSubmission submission = voteSubmissionMapper.selectById(voteSubmissionDto.getId());
+        if (submission.getPromoteStatus().equals(PROMOTE_0)) {
+            throw new ServiceException("已晋级的作品不能继续晋级");
+        }
+        voteSubmissionDto.setAppraiseStatus("2");
+        return voteSubmissionMapper.updateById(voteSubmissionDto);
+    }
+
 
 }
 

+ 5 - 2
vctgo-modules/vctgo-vote-system/src/main/java/com/vote/system/service/impl/VoteWorkTypesServiceImpl.java

@@ -24,8 +24,7 @@ import java.util.List;
  * @createDate 2024-08-12 17:01:34
  */
 @Service
-public class VoteWorkTypesServiceImpl extends ServiceImpl<VoteWorkTypesMapper, VoteWorkTypes>
-        implements VoteWorkTypesService {
+public class VoteWorkTypesServiceImpl extends ServiceImpl<VoteWorkTypesMapper, VoteWorkTypes> implements VoteWorkTypesService {
 
     @Autowired
     private VoteWorkTypesMapper voteWorkTypesMapper;
@@ -47,6 +46,10 @@ public class VoteWorkTypesServiceImpl extends ServiceImpl<VoteWorkTypesMapper, V
         Page<VoteWorkTypes> page = new Page<>(pageNum, pageSize);
         // 查询
         LambdaQueryWrapper<VoteWorkTypes> wrapper = new LambdaQueryWrapper<>();
+        if (voteWorkTypes.getName() != null) {
+            wrapper.like(VoteWorkTypes::getName, voteWorkTypes.getName());
+        }
+        wrapper.orderByDesc(VoteWorkTypes::getCreatedAt);
         List<VoteWorkTypes> workTypes = voteWorkTypesMapper.selectList(wrapper);
         page.setTotal(workTypes.size());
         page.setRecords(workTypes);

+ 11 - 9
vctgo-modules/vctgo-vote-system/src/main/resources/mapper/VoteEvaluationTasksMapper.xml

@@ -5,23 +5,25 @@
 <mapper namespace="com.vote.system.mapper.VoteEvaluationTasksMapper">
 
     <resultMap id="BaseResultMap" type="com.vote.system.domain.VoteEvaluationTasks">
-            <id property="id" column="id" jdbcType="BIGINT"/>
-            <result property="submissionId" column="submission_id" jdbcType="BIGINT"/>
-            <result property="judgeId" column="judge_id" jdbcType="VARCHAR"/>
-            <result property="status" column="status" jdbcType="TINYINT"/>
-            <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
-            <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
+        <id property="id" column="id" jdbcType="BIGINT"/>
+        <result property="submissionId" column="submission_id" jdbcType="BIGINT"/>
+        <result property="judgeId" column="judge_id" jdbcType="VARCHAR"/>
+        <result property="roundId" column="round_id" jdbcType="BIGINT"/>
+        <result property="status" column="status" jdbcType="TINYINT"/>
+        <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
+        <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,submission_id,judge_id,
+        id
+        ,submission_id,judge_id,
         status,created_at,updated_at
     </sql>
     <insert id="insertBatch">
-        INSERT INTO vote_evaluation_tasks (submission_id, judge_id)
+        INSERT INTO vote_evaluation_tasks (submission_id, judge_id,round_id)
         VALUES
         <foreach collection="list" item="task" separator=",">
-            (#{task.submissionId}, #{task.judgeId})
+            (#{task.submissionId}, #{task.judgeId} , #{task.roundId})
         </foreach>
     </insert>
 

+ 1 - 0
vctgo-modules/vctgo-vote-system/src/main/resources/mapper/VoteEventNewsCarouselsMapper.xml

@@ -8,6 +8,7 @@
             <id property="id" column="id" jdbcType="BIGINT"/>
             <result property="eventId" column="event_id" jdbcType="BIGINT"/>
             <result property="imageUrl" column="image_url" jdbcType="VARCHAR"/>
+            <result property="isDelete" column="is_delete" jdbcType="CHAR"/>
             <result property="newsId" column="news_id" jdbcType="BIGINT"/>
             <result property="sortOrder" column="sort_order" jdbcType="INTEGER"/>
             <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>

+ 12 - 10
vctgo-modules/vctgo-vote-system/src/main/resources/mapper/VoteEventRegistrationWorkScoresMapper.xml

@@ -5,19 +5,21 @@
 <mapper namespace="com.vote.system.mapper.VoteEventRegistrationWorkScoresMapper">
 
     <resultMap id="BaseResultMap" type="com.vote.system.domain.VoteEventRegistrationWorkScores">
-            <id property="id" column="id" jdbcType="BIGINT"/>
-            <result property="eventId" column="event_id" jdbcType="BIGINT"/>
-            <result property="workSettingsId" column="work_settings_id" jdbcType="BIGINT"/>
-            <result property="submissionId" column="submission_id" jdbcType="BIGINT"/>
-            <result property="judgeId" column="judge_id" jdbcType="BIGINT"/>
-            <result property="score" column="score" jdbcType="DECIMAL"/>
-            <result property="comments" column="comments" jdbcType="VARCHAR"/>
-            <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
-            <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
+        <id property="id" column="id" jdbcType="BIGINT"/>
+        <result property="eventId" column="event_id" jdbcType="BIGINT"/>
+        <result property="workSettingsId" column="work_settings_id" jdbcType="BIGINT"/>
+        <result property="submissionId" column="submission_id" jdbcType="BIGINT"/>
+        <result property="roundId" column="round_id" jdbcType="BIGINT"/>
+        <result property="judgeId" column="judge_id" jdbcType="BIGINT"/>
+        <result property="score" column="score" jdbcType="DECIMAL"/>
+        <result property="comments" column="comments" jdbcType="VARCHAR"/>
+        <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
+        <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,event_id,work_settings_id,
+        id
+        ,event_id,work_settings_id,
         submission_id,judge_id,score,
         comments,created_at,updated_at
     </sql>

+ 20 - 0
vctgo-modules/vctgo-vote-system/src/main/resources/mapper/VoteHistoryScoreMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.vote.system.mapper.VoteHistoryScoreMapper">
+
+    <resultMap id="BaseResultMap" type="com.vote.system.domain.VoteHistoryScore">
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="submissionId" column="submission_id" jdbcType="BIGINT"/>
+            <result property="roundId" column="round_id" jdbcType="BIGINT"/>
+            <result property="alternately" column="alternately" jdbcType="VARCHAR"/>
+            <result property="score" column="score" jdbcType="VARCHAR"/>
+            <result property="result" column="result" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,submission_id,alternately,
+        score,result
+    </sql>
+</mapper>

+ 1 - 0
vctgo-modules/vctgo-vote-system/src/main/resources/mapper/VoteSubmissionItemMapper.xml

@@ -8,6 +8,7 @@
             <id property="id" column="id" jdbcType="BIGINT"/>
             <result property="submissionId" column="submission_id" jdbcType="BIGINT"/>
             <result property="itemId" column="item_id" jdbcType="BIGINT"/>
+        <result property="roundId" column="round_id" jdbcType="BIGINT"/>
             <result property="score" column="score" jdbcType="DECIMAL"/>
             <result property="tenantId" column="tenant_id" jdbcType="BIGINT"/>
             <result property="isDeleted" column="is_deleted" jdbcType="CHAR"/>

+ 10 - 0
vctgo-modules/vctgo-vote-system/src/main/resources/mapper/VoteSubmissionMapper.xml

@@ -43,4 +43,14 @@
         create_at,update_by_id,update_at,
         tenant_id
     </sql>
+
+    <update id="updateBatch">
+        UPDATE vote_submission
+        SET appraise_status = '1', update_at = NOW()
+        WHERE id IN
+        <foreach item="id" collection="submissionIds" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+
+    </update>
 </mapper>