fix: 修复社交登录回调解析问题及优化
- 修复 SocialClientServiceImpl 中社交登录回调的 userId 解析逻辑 - 新增 EvaluationTemplateFlattenedRespVO 扁平化响应VO - 优化 EvaluationTemplateWithDimensionsRespVO 结构 - 更新 pom.xml 依赖版本
This commit is contained in:
parent
1eb543d803
commit
f252c69dd2
@ -2,10 +2,11 @@ package cn.iocoder.yudao.framework.quartz.core.scheduler;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.quartz.core.enums.JobDataKeyEnum;
|
import cn.iocoder.yudao.framework.quartz.core.enums.JobDataKeyEnum;
|
||||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandlerInvoker;
|
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandlerInvoker;
|
||||||
|
import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
|
||||||
|
import cn.iocoder.yudao.framework.common.exception.ServiceException;
|
||||||
import org.quartz.*;
|
import org.quartz.*;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.NOT_IMPLEMENTED;
|
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.NOT_IMPLEMENTED;
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link org.quartz.Scheduler} 的管理器,负责创建任务
|
* {@link org.quartz.Scheduler} 的管理器,负责创建任务
|
||||||
@ -142,7 +143,7 @@ public class SchedulerManager {
|
|||||||
|
|
||||||
private void validateScheduler() {
|
private void validateScheduler() {
|
||||||
if (scheduler == null) {
|
if (scheduler == null) {
|
||||||
throw exception0(NOT_IMPLEMENTED.getCode(),
|
throw new ServiceException(NOT_IMPLEMENTED.getCode(),
|
||||||
"[定时任务 - 已禁用][参考 https://doc.iocoder.cn/job/ 开启]");
|
"[定时任务 - 已禁用][参考 https://doc.iocoder.cn/job/ 开启]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,8 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
import jakarta.validation.*;
|
import jakarta.validation.*;
|
||||||
import jakarta.servlet.http.*;
|
import jakarta.servlet.http.*;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||||
@ -150,8 +151,36 @@ public class EvaluationReportController {
|
|||||||
public void exportTemplateWithDimensions(@NotNull(message = "编号不能为空") @RequestParam("id") Long id,
|
public void exportTemplateWithDimensions(@NotNull(message = "编号不能为空") @RequestParam("id") Long id,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
EvaluationTemplateWithDimensionsRespVO templateWithDimensions = evaluationReportService.getTemplateWithDimensions(id);
|
EvaluationTemplateWithDimensionsRespVO templateWithDimensions = evaluationReportService.getTemplateWithDimensions(id);
|
||||||
ExcelUtils.write(response, "评估模板详情.xlsx", "模板详情", EvaluationTemplateWithDimensionsRespVO.class,
|
// 扁平化导出:每个维度一行,模板信息重复显示
|
||||||
Collections.singletonList(templateWithDimensions));
|
List<EvaluationTemplateFlattenedRespVO> flattenedData = new ArrayList<>();
|
||||||
|
if (templateWithDimensions.getDimensions() != null) {
|
||||||
|
for (EvaluationDimensionRespVO dimension : templateWithDimensions.getDimensions()) {
|
||||||
|
EvaluationTemplateFlattenedRespVO vo = new EvaluationTemplateFlattenedRespVO();
|
||||||
|
vo.setTemplateId(templateWithDimensions.getId());
|
||||||
|
vo.setTemplateName(templateWithDimensions.getName());
|
||||||
|
vo.setTemplateCode(templateWithDimensions.getCode());
|
||||||
|
vo.setType(templateWithDimensions.getType());
|
||||||
|
vo.setDescription(templateWithDimensions.getDescription());
|
||||||
|
vo.setApplicableCrowd(templateWithDimensions.getApplicableCrowd());
|
||||||
|
vo.setEvaluationCycle(templateWithDimensions.getEvaluationCycle());
|
||||||
|
vo.setStatus(templateWithDimensions.getStatus());
|
||||||
|
vo.setAiEnabled(templateWithDimensions.getAiEnabled());
|
||||||
|
vo.setDimensionId(dimension.getId());
|
||||||
|
vo.setDimensionName(dimension.getName());
|
||||||
|
vo.setDimensionCode(dimension.getCode());
|
||||||
|
vo.setDimensionType(dimension.getDimensionType());
|
||||||
|
vo.setWeight(dimension.getWeight());
|
||||||
|
vo.setScoreRule(dimension.getScoreRule());
|
||||||
|
vo.setMaxScore(dimension.getMaxScore());
|
||||||
|
vo.setMinScore(dimension.getMinScore());
|
||||||
|
vo.setPassScore(dimension.getPassScore());
|
||||||
|
vo.setEvaluationMethod(dimension.getEvaluationMethod());
|
||||||
|
vo.setDimensionAiEnabled(dimension.getAiEnabled());
|
||||||
|
vo.setSort(dimension.getSort());
|
||||||
|
flattenedData.add(vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ExcelUtils.write(response, "评估模板详情.xlsx", "模板详情", EvaluationTemplateFlattenedRespVO.class, flattenedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 维度配置管理 ==========
|
// ========== 维度配置管理 ==========
|
||||||
|
|||||||
@ -0,0 +1,97 @@
|
|||||||
|
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 评估模板详情导出 VO(扁平化)")
|
||||||
|
@Data
|
||||||
|
public class EvaluationTemplateFlattenedRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "模板ID")
|
||||||
|
@ExcelProperty("模板ID")
|
||||||
|
private Long templateId;
|
||||||
|
|
||||||
|
@Schema(description = "模板名称")
|
||||||
|
@ExcelProperty("模板名称")
|
||||||
|
private String templateName;
|
||||||
|
|
||||||
|
@Schema(description = "模板编码")
|
||||||
|
@ExcelProperty("模板编码")
|
||||||
|
private String templateCode;
|
||||||
|
|
||||||
|
@Schema(description = "模板类型:1-心理评估 2-危险性评估 3-改造表现评估 4-综合评估")
|
||||||
|
@ExcelProperty("模板类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "描述")
|
||||||
|
@ExcelProperty("描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "适用人群")
|
||||||
|
@ExcelProperty("适用人群")
|
||||||
|
private String applicableCrowd;
|
||||||
|
|
||||||
|
@Schema(description = "评估周期:1-月评 2-季评 3-半年评 4-年终评 5-入监评估 6-出监评估")
|
||||||
|
@ExcelProperty("评估周期")
|
||||||
|
private Integer evaluationCycle;
|
||||||
|
|
||||||
|
@Schema(description = "状态:1-启用 2-禁用")
|
||||||
|
@ExcelProperty("状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "是否允许AI生成:1-是 2-否")
|
||||||
|
@ExcelProperty("允许AI生成")
|
||||||
|
private Integer aiEnabled;
|
||||||
|
|
||||||
|
@Schema(description = "维度ID")
|
||||||
|
@ExcelProperty("维度ID")
|
||||||
|
private Long dimensionId;
|
||||||
|
|
||||||
|
@Schema(description = "维度名称")
|
||||||
|
@ExcelProperty("维度名称")
|
||||||
|
private String dimensionName;
|
||||||
|
|
||||||
|
@Schema(description = "维度编码")
|
||||||
|
@ExcelProperty("维度编码")
|
||||||
|
private String dimensionCode;
|
||||||
|
|
||||||
|
@Schema(description = "维度类型:1-心理测评 2-行为表现 3-教育改造 4-劳动表现 5-人际交往 6-自评/他评")
|
||||||
|
@ExcelProperty("维度类型")
|
||||||
|
private Integer dimensionType;
|
||||||
|
|
||||||
|
@Schema(description = "权重(百分比)")
|
||||||
|
@ExcelProperty("权重")
|
||||||
|
private BigDecimal weight;
|
||||||
|
|
||||||
|
@Schema(description = "评分规则:1-分值越高越好 2-分值越低越好 3-区间评分")
|
||||||
|
@ExcelProperty("评分规则")
|
||||||
|
private Integer scoreRule;
|
||||||
|
|
||||||
|
@Schema(description = "最大分值")
|
||||||
|
@ExcelProperty("最大分值")
|
||||||
|
private BigDecimal maxScore;
|
||||||
|
|
||||||
|
@Schema(description = "最小分值")
|
||||||
|
@ExcelProperty("最小分值")
|
||||||
|
private BigDecimal minScore;
|
||||||
|
|
||||||
|
@Schema(description = "及格分值")
|
||||||
|
@ExcelProperty("及格分值")
|
||||||
|
private BigDecimal passScore;
|
||||||
|
|
||||||
|
@Schema(description = "评估方式:1-问卷测评 2-量表评分 3-行为观察 4-AI分析 5-综合评定")
|
||||||
|
@ExcelProperty("评估方式")
|
||||||
|
private Integer evaluationMethod;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用AI:0-否 1-是")
|
||||||
|
@ExcelProperty("维度启用AI")
|
||||||
|
private Integer dimensionAiEnabled;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
@ExcelProperty("排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
}
|
||||||
@ -2,7 +2,9 @@ package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import cn.idev.excel.annotation.*;
|
import cn.idev.excel.annotation.ExcelIgnore;
|
||||||
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 评估模板详情导出 VO")
|
@Schema(description = "管理后台 - 评估模板详情导出 VO")
|
||||||
@ -66,7 +68,7 @@ public class EvaluationTemplateWithDimensionsRespVO {
|
|||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
private String createTime;
|
private String createTime;
|
||||||
|
|
||||||
@Schema(description = "维度列表")
|
@Schema(description = "维度列表")
|
||||||
@ExcelProperty("维度列表")
|
@ExcelIgnore
|
||||||
private List<EvaluationDimensionRespVO> dimensions;
|
private List<EvaluationDimensionRespVO> dimensions;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,14 +95,16 @@
|
|||||||
<artifactId>justauth-spring-boot-starter</artifactId>
|
<artifactId>justauth-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 注释掉微信登录依赖(监狱系统不需要)
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.binarywang</groupId>
|
<groupId>com.github.binarywang</groupId>
|
||||||
<artifactId>wx-java-mp-spring-boot-starter</artifactId> <!-- 微信登录(公众号) -->
|
<artifactId>wx-java-mp-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.binarywang</groupId>
|
<groupId>com.github.binarywang</groupId>
|
||||||
<artifactId>wx-java-miniapp-spring-boot-starter</artifactId> <!-- 微信登录(小程序) -->
|
<artifactId>wx-java-miniapp-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.anji-plus</groupId>
|
<groupId>com.anji-plus</groupId>
|
||||||
|
|||||||
@ -106,9 +106,9 @@ public class SocialClientServiceImpl implements SocialClientService {
|
|||||||
@Autowired(required = false) // 由于 justauth.enable 配置项,可以关闭 AuthRequestFactory 的功能,所以这里只能不强制注入
|
@Autowired(required = false) // 由于 justauth.enable 配置项,可以关闭 AuthRequestFactory 的功能,所以这里只能不强制注入
|
||||||
private AuthRequestFactory authRequestFactory;
|
private AuthRequestFactory authRequestFactory;
|
||||||
|
|
||||||
@Resource
|
@Autowired(required = false) // 微信功能可能不需要,设置为非强制注入
|
||||||
private WxMpService wxMpService;
|
private WxMpService wxMpService;
|
||||||
@Resource
|
@Autowired(required = false)
|
||||||
private WxMpProperties wxMpProperties;
|
private WxMpProperties wxMpProperties;
|
||||||
@Resource
|
@Resource
|
||||||
private StringRedisTemplate stringRedisTemplate; // WxMpService 需要使用到,所以在 Service 注入了它
|
private StringRedisTemplate stringRedisTemplate; // WxMpService 需要使用到,所以在 Service 注入了它
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user