Merge branch 'master' of https://gitee.com/xiao12feng/xinli
This commit is contained in:
commit
ecc908607c
|
|
@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.ddnai.common.annotation.Log;
|
import com.ddnai.common.annotation.Log;
|
||||||
import com.ddnai.common.core.controller.BaseController;
|
import com.ddnai.common.core.controller.BaseController;
|
||||||
|
|
@ -27,12 +26,6 @@ import com.ddnai.system.domain.psychology.PsyScaleItem;
|
||||||
import com.ddnai.system.domain.psychology.PsyAssessmentAnswer;
|
import com.ddnai.system.domain.psychology.PsyAssessmentAnswer;
|
||||||
import com.ddnai.system.domain.vo.AssessmentStartVO;
|
import com.ddnai.system.domain.vo.AssessmentStartVO;
|
||||||
import com.ddnai.system.domain.vo.AssessmentAnswerVO;
|
import com.ddnai.system.domain.vo.AssessmentAnswerVO;
|
||||||
import com.ddnai.system.domain.psychology.vo.AssessmentAnalyticsQuery;
|
|
||||||
import com.ddnai.system.domain.psychology.vo.AssessmentAnalyticsVO;
|
|
||||||
import com.ddnai.system.domain.psychology.vo.ScaleDeptStatsQuery;
|
|
||||||
import com.ddnai.system.domain.psychology.vo.ScaleDeptStatsVO;
|
|
||||||
import com.ddnai.system.domain.psychology.vo.StudentOptionVO;
|
|
||||||
import com.ddnai.system.domain.psychology.vo.UserAssessmentSummaryVO;
|
|
||||||
import com.ddnai.system.service.psychology.IPsyAssessmentService;
|
import com.ddnai.system.service.psychology.IPsyAssessmentService;
|
||||||
import com.ddnai.system.service.psychology.IPsyAssessmentAnswerService;
|
import com.ddnai.system.service.psychology.IPsyAssessmentAnswerService;
|
||||||
import com.ddnai.system.service.psychology.IPsyScaleItemService;
|
import com.ddnai.system.service.psychology.IPsyScaleItemService;
|
||||||
|
|
@ -72,56 +65,6 @@ public class PsyAssessmentController extends BaseController
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 全员测评分析
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('psychology:assessment:list')")
|
|
||||||
@GetMapping("/analytics")
|
|
||||||
public AjaxResult analytics(AssessmentAnalyticsQuery query)
|
|
||||||
{
|
|
||||||
AssessmentAnalyticsVO analytics = assessmentService.getAssessmentAnalytics(query);
|
|
||||||
return success(analytics);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学员选项搜索
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('psychology:assessment:list')")
|
|
||||||
@GetMapping("/student/options")
|
|
||||||
public AjaxResult studentOptions(@RequestParam(required = false) String keyword,
|
|
||||||
@RequestParam(required = false) Long deptId,
|
|
||||||
@RequestParam(required = false) Integer limit)
|
|
||||||
{
|
|
||||||
List<StudentOptionVO> options = assessmentService.searchStudentOptions(keyword, deptId, limit);
|
|
||||||
return success(options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 学员测评概览
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('psychology:assessment:list')")
|
|
||||||
@GetMapping("/userSummary/{userId}")
|
|
||||||
public AjaxResult userSummary(@PathVariable Long userId)
|
|
||||||
{
|
|
||||||
UserAssessmentSummaryVO summary = assessmentService.getUserAssessmentSummary(userId);
|
|
||||||
if (summary == null)
|
|
||||||
{
|
|
||||||
return error("学员不存在或无测评记录");
|
|
||||||
}
|
|
||||||
return success(summary);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 量表-单位统计
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('psychology:assessment:list')")
|
|
||||||
@PostMapping("/scaleDeptStats")
|
|
||||||
public AjaxResult scaleDeptStats(@RequestBody ScaleDeptStatsQuery query)
|
|
||||||
{
|
|
||||||
ScaleDeptStatsVO stats = assessmentService.getScaleDeptStats(query);
|
|
||||||
return success(stats);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户的测评列表
|
* 获取用户的测评列表
|
||||||
*/
|
*/
|
||||||
|
|
@ -175,16 +118,16 @@ public class PsyAssessmentController extends BaseController
|
||||||
public AjaxResult start(@Validated @RequestBody AssessmentStartVO startVO)
|
public AjaxResult start(@Validated @RequestBody AssessmentStartVO startVO)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Long userId;
|
Long userId = null;
|
||||||
String username;
|
String username = null;
|
||||||
|
|
||||||
// 必须登录后才能开始测评
|
// 尝试获取当前登录用户信息
|
||||||
try {
|
try {
|
||||||
userId = SecurityUtils.getUserId();
|
userId = SecurityUtils.getUserId();
|
||||||
username = SecurityUtils.getUsername();
|
username = SecurityUtils.getUsername();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn("匿名用户尝试开始测评: {}", e.getMessage());
|
logger.warn("获取用户信息失败,可能是匿名访问: {}", e.getMessage());
|
||||||
return error("请先登录学员账号后再开始测评");
|
// 如果是匿名访问,userId 和 username 可以为 null
|
||||||
}
|
}
|
||||||
|
|
||||||
PsyAssessment assessment = new PsyAssessment();
|
PsyAssessment assessment = new PsyAssessment();
|
||||||
|
|
@ -198,9 +141,17 @@ public class PsyAssessmentController extends BaseController
|
||||||
assessment.setIpAddress(IpUtils.getIpAddr());
|
assessment.setIpAddress(IpUtils.getIpAddr());
|
||||||
assessment.setUserAgent(ServletUtils.getRequest().getHeader("User-Agent"));
|
assessment.setUserAgent(ServletUtils.getRequest().getHeader("User-Agent"));
|
||||||
|
|
||||||
// 绑定创建人信息
|
// 设置用户ID(如果获取到了)
|
||||||
assessment.setUserId(userId);
|
if (userId != null) {
|
||||||
assessment.setCreateBy(username);
|
assessment.setUserId(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置创建者(如果获取到了)
|
||||||
|
if (username != null && !username.isEmpty()) {
|
||||||
|
assessment.setCreateBy(username);
|
||||||
|
} else {
|
||||||
|
assessment.setCreateBy("system"); // 默认值
|
||||||
|
}
|
||||||
|
|
||||||
logger.info("创建测评 - scaleId: {}, userId: {}, assesseeName: {}",
|
logger.info("创建测评 - scaleId: {}, userId: {}, assesseeName: {}",
|
||||||
startVO.getScaleId(), userId, startVO.getAssesseeName());
|
startVO.getScaleId(), userId, startVO.getAssesseeName());
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,6 @@ import com.ddnai.common.utils.ServletUtils;
|
||||||
import com.ddnai.common.utils.poi.ExcelUtil;
|
import com.ddnai.common.utils.poi.ExcelUtil;
|
||||||
import com.ddnai.system.domain.psychology.PsyQrcode;
|
import com.ddnai.system.domain.psychology.PsyQrcode;
|
||||||
import com.ddnai.system.service.psychology.IPsyQrcodeService;
|
import com.ddnai.system.service.psychology.IPsyQrcodeService;
|
||||||
import com.ddnai.system.service.psychology.IPsyAssessmentReportService;
|
|
||||||
import com.ddnai.system.domain.psychology.PsyAssessmentReport;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -41,9 +39,6 @@ public class PsyQrcodeController extends BaseController
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPsyQrcodeService qrcodeService;
|
private IPsyQrcodeService qrcodeService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private IPsyAssessmentReportService assessmentReportService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取二维码列表
|
* 获取二维码列表
|
||||||
*/
|
*/
|
||||||
|
|
@ -463,8 +458,8 @@ public class PsyQrcodeController extends BaseController
|
||||||
// 构建跳转地址
|
// 构建跳转地址
|
||||||
String redirectUrl = buildRedirectUrl(qrcode);
|
String redirectUrl = buildRedirectUrl(qrcode);
|
||||||
|
|
||||||
// 构建完整的跳转URL(包含域名和端口)
|
// 构建完整的跳转URL(包含域名和端口)
|
||||||
String fullRedirectUrl = buildFullRedirectUrl(redirectUrl);
|
String fullRedirectUrl = buildFullRedirectUrl(redirectUrl);
|
||||||
|
|
||||||
// 只返回必要的跳转信息,不返回Base64数据以提升性能
|
// 只返回必要的跳转信息,不返回Base64数据以提升性能
|
||||||
java.util.Map<String, Object> data = new java.util.HashMap<>();
|
java.util.Map<String, Object> data = new java.util.HashMap<>();
|
||||||
|
|
@ -508,16 +503,6 @@ public class PsyQrcodeController extends BaseController
|
||||||
return redirectUrl;
|
return redirectUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 报告下载接口必须直接访问后端地址,避免被前端路由截获
|
|
||||||
if (redirectUrl.startsWith("/psychology/report/publicDownload"))
|
|
||||||
{
|
|
||||||
String backendAddress = buildBackendApiAddress();
|
|
||||||
if (StringUtils.isNotEmpty(backendAddress))
|
|
||||||
{
|
|
||||||
return backendAddress + redirectUrl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 使用与二维码生成相同的逻辑,构建前端地址
|
// 使用与二维码生成相同的逻辑,构建前端地址
|
||||||
String serverAddress = buildServerAddress();
|
String serverAddress = buildServerAddress();
|
||||||
|
|
||||||
|
|
@ -557,46 +542,6 @@ public class PsyQrcodeController extends BaseController
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 构建后端API地址(包含端口),用于直接访问下载等后端接口
|
|
||||||
*/
|
|
||||||
private String buildBackendApiAddress()
|
|
||||||
{
|
|
||||||
javax.servlet.http.HttpServletRequest request = ServletUtils.getRequest();
|
|
||||||
if (request != null)
|
|
||||||
{
|
|
||||||
String scheme = request.getScheme();
|
|
||||||
String serverName = request.getServerName();
|
|
||||||
int serverPort = request.getServerPort();
|
|
||||||
|
|
||||||
StringBuilder url = new StringBuilder();
|
|
||||||
url.append(scheme).append("://").append(serverName);
|
|
||||||
if (serverPort != 80 && serverPort != 443)
|
|
||||||
{
|
|
||||||
url.append(":").append(serverPort);
|
|
||||||
}
|
|
||||||
|
|
||||||
String result = url.toString();
|
|
||||||
if (result.contains("localhost") || result.contains("127.0.0.1"))
|
|
||||||
{
|
|
||||||
String localIp = getLocalNetworkIp();
|
|
||||||
if (StringUtils.isNotEmpty(localIp))
|
|
||||||
{
|
|
||||||
result = result.replace("localhost", localIp)
|
|
||||||
.replace("127.0.0.1", localIp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
String localIp = getLocalNetworkIp();
|
|
||||||
if (StringUtils.isNotEmpty(localIp))
|
|
||||||
{
|
|
||||||
return "http://" + localIp + ":30081";
|
|
||||||
}
|
|
||||||
return "http://localhost:30081";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建跳转地址
|
* 构建跳转地址
|
||||||
*
|
*
|
||||||
|
|
@ -609,16 +554,6 @@ public class PsyQrcodeController extends BaseController
|
||||||
String targetType = qrcode.getTargetType();
|
String targetType = qrcode.getTargetType();
|
||||||
Long targetId = qrcode.getTargetId();
|
Long targetId = qrcode.getTargetId();
|
||||||
|
|
||||||
boolean isReportQrcode = ("report".equals(targetType) && targetId != null)
|
|
||||||
|| ("view_report".equals(qrcodeType) && targetId != null);
|
|
||||||
|
|
||||||
// 只要目标指向报告,统一走扫码即下载逻辑(兼容旧数据 targetType 为空的情况)
|
|
||||||
if (isReportQrcode)
|
|
||||||
{
|
|
||||||
String format = resolveReportFormat(qrcode);
|
|
||||||
return "/psychology/report/publicDownload/" + targetId + "?format=" + format;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据二维码类型和目标类型构建跳转地址
|
// 根据二维码类型和目标类型构建跳转地址
|
||||||
if ("test".equals(qrcodeType))
|
if ("test".equals(qrcodeType))
|
||||||
{
|
{
|
||||||
|
|
@ -641,24 +576,21 @@ public class PsyQrcodeController extends BaseController
|
||||||
}
|
}
|
||||||
else if ("view_report".equals(qrcodeType))
|
else if ("view_report".equals(qrcodeType))
|
||||||
{
|
{
|
||||||
// 查看报告类型:扫码后直接下载报告文件(无需登录)
|
// 查看报告类型
|
||||||
String format = resolveReportFormat(qrcode);
|
|
||||||
|
|
||||||
// 目前“查看报告”二维码在前端固定使用 report 作为目标类型,这里优先按 reportId 处理
|
|
||||||
if ("report".equals(targetType) && targetId != null)
|
if ("report".equals(targetType) && targetId != null)
|
||||||
{
|
{
|
||||||
// 公开下载接口:/psychology/report/publicDownload/{reportId}?format=xxx
|
// 跳转到报告详情页面
|
||||||
return "/psychology/report/publicDownload/" + targetId + "?format=" + format;
|
return "/psychology/report/detail?reportId=" + targetId;
|
||||||
}
|
}
|
||||||
else if ("assessment".equals(targetType) && targetId != null)
|
else if ("assessment".equals(targetType) && targetId != null)
|
||||||
{
|
{
|
||||||
// 兼容历史数据:如果通过测评ID生成的二维码,仍保持原有跳转到报告页的行为
|
// 通过测评ID查看报告
|
||||||
return "/psychology/assessment/report?assessmentId=" + targetId;
|
return "/psychology/report/detail?assessmentId=" + targetId;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 无有效目标时,退回首页,避免异常
|
// 跳转到报告列表页面
|
||||||
return "/index";
|
return "/psychology/report";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ("register".equals(qrcodeType))
|
else if ("register".equals(qrcodeType))
|
||||||
|
|
@ -678,60 +610,6 @@ public class PsyQrcodeController extends BaseController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据报告ID获取对应的测评ID
|
|
||||||
*/
|
|
||||||
private Long resolveAssessmentIdByReportId(Long reportId)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
PsyAssessmentReport report = assessmentReportService.selectReportById(reportId);
|
|
||||||
if (report != null)
|
|
||||||
{
|
|
||||||
return report.getAssessmentId();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
logger.warn("根据报告ID({})解析测评ID失败: {}", reportId, e.getMessage());
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 从二维码备注中解析报告导出格式(excel/pdf)
|
|
||||||
* 约定:备注前缀形如 [FORMAT:pdf] 或 [FORMAT:excel]
|
|
||||||
*/
|
|
||||||
private String resolveReportFormat(PsyQrcode qrcode)
|
|
||||||
{
|
|
||||||
String defaultFormat = "pdf";
|
|
||||||
if (qrcode == null)
|
|
||||||
{
|
|
||||||
return defaultFormat;
|
|
||||||
}
|
|
||||||
String remark = qrcode.getRemark();
|
|
||||||
if (StringUtils.isEmpty(remark))
|
|
||||||
{
|
|
||||||
return defaultFormat;
|
|
||||||
}
|
|
||||||
String trimmed = remark.trim();
|
|
||||||
if (!trimmed.startsWith("[FORMAT:"))
|
|
||||||
{
|
|
||||||
return defaultFormat;
|
|
||||||
}
|
|
||||||
int endIndex = trimmed.indexOf(']');
|
|
||||||
if (endIndex <= 8)
|
|
||||||
{
|
|
||||||
return defaultFormat;
|
|
||||||
}
|
|
||||||
String inner = trimmed.substring(8, endIndex).toLowerCase();
|
|
||||||
if ("excel".equals(inner) || "pdf".equals(inner))
|
|
||||||
{
|
|
||||||
return inner;
|
|
||||||
}
|
|
||||||
return defaultFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 快速生成量表测评二维码
|
* 快速生成量表测评二维码
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ referer:
|
||||||
# 防盗链开关
|
# 防盗链开关
|
||||||
enabled: false
|
enabled: false
|
||||||
# 允许的域名列表
|
# 允许的域名列表
|
||||||
allowed-domains: localhost,127.0.0.1,1.15.149.240
|
allowed-domains: localhost,127.0.0.1
|
||||||
|
|
||||||
# 防止XSS攻击
|
# 防止XSS攻击
|
||||||
xss:
|
xss:
|
||||||
|
|
|
||||||
|
|
@ -69,48 +69,6 @@ public class PsyUserProfile extends BaseEntity
|
||||||
/** 部门名称 */
|
/** 部门名称 */
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
/** 罪犯姓名 */
|
|
||||||
private String prisonerName;
|
|
||||||
|
|
||||||
/** 信息编号 */
|
|
||||||
private String infoNumber;
|
|
||||||
|
|
||||||
/** 监狱 */
|
|
||||||
private String prisonName;
|
|
||||||
|
|
||||||
/** 监区编码(班级) */
|
|
||||||
private String prisonAreaCode;
|
|
||||||
|
|
||||||
/** 监区名称(班级名称) */
|
|
||||||
private String prisonAreaName;
|
|
||||||
|
|
||||||
/** 性别 */
|
|
||||||
private String gender;
|
|
||||||
|
|
||||||
/** 民族 */
|
|
||||||
private String nation;
|
|
||||||
|
|
||||||
/** 文化程度 */
|
|
||||||
private String educationLevel;
|
|
||||||
|
|
||||||
/** 罪名 */
|
|
||||||
private String crimeName;
|
|
||||||
|
|
||||||
/** 刑期描述 */
|
|
||||||
private String sentenceTerm;
|
|
||||||
|
|
||||||
/** 刑期起日 */
|
|
||||||
private String sentenceStartDate;
|
|
||||||
|
|
||||||
/** 刑期止日 */
|
|
||||||
private String sentenceEndDate;
|
|
||||||
|
|
||||||
/** 入监时间 */
|
|
||||||
private String entryDate;
|
|
||||||
|
|
||||||
/** 状态(在押/释放/假释/外出) */
|
|
||||||
private String custodyStatus;
|
|
||||||
|
|
||||||
public Long getProfileId()
|
public Long getProfileId()
|
||||||
{
|
{
|
||||||
return profileId;
|
return profileId;
|
||||||
|
|
@ -291,146 +249,6 @@ public class PsyUserProfile extends BaseEntity
|
||||||
this.deptName = deptName;
|
this.deptName = deptName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPrisonerName()
|
|
||||||
{
|
|
||||||
return prisonerName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrisonerName(String prisonerName)
|
|
||||||
{
|
|
||||||
this.prisonerName = prisonerName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getInfoNumber()
|
|
||||||
{
|
|
||||||
return infoNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInfoNumber(String infoNumber)
|
|
||||||
{
|
|
||||||
this.infoNumber = infoNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPrisonName()
|
|
||||||
{
|
|
||||||
return prisonName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrisonName(String prisonName)
|
|
||||||
{
|
|
||||||
this.prisonName = prisonName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPrisonAreaCode()
|
|
||||||
{
|
|
||||||
return prisonAreaCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrisonAreaCode(String prisonAreaCode)
|
|
||||||
{
|
|
||||||
this.prisonAreaCode = prisonAreaCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPrisonAreaName()
|
|
||||||
{
|
|
||||||
return prisonAreaName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrisonAreaName(String prisonAreaName)
|
|
||||||
{
|
|
||||||
this.prisonAreaName = prisonAreaName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGender()
|
|
||||||
{
|
|
||||||
return gender;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGender(String gender)
|
|
||||||
{
|
|
||||||
this.gender = gender;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNation()
|
|
||||||
{
|
|
||||||
return nation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNation(String nation)
|
|
||||||
{
|
|
||||||
this.nation = nation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEducationLevel()
|
|
||||||
{
|
|
||||||
return educationLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEducationLevel(String educationLevel)
|
|
||||||
{
|
|
||||||
this.educationLevel = educationLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCrimeName()
|
|
||||||
{
|
|
||||||
return crimeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCrimeName(String crimeName)
|
|
||||||
{
|
|
||||||
this.crimeName = crimeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSentenceTerm()
|
|
||||||
{
|
|
||||||
return sentenceTerm;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSentenceTerm(String sentenceTerm)
|
|
||||||
{
|
|
||||||
this.sentenceTerm = sentenceTerm;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSentenceStartDate()
|
|
||||||
{
|
|
||||||
return sentenceStartDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSentenceStartDate(String sentenceStartDate)
|
|
||||||
{
|
|
||||||
this.sentenceStartDate = sentenceStartDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSentenceEndDate()
|
|
||||||
{
|
|
||||||
return sentenceEndDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSentenceEndDate(String sentenceEndDate)
|
|
||||||
{
|
|
||||||
this.sentenceEndDate = sentenceEndDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEntryDate()
|
|
||||||
{
|
|
||||||
return entryDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEntryDate(String entryDate)
|
|
||||||
{
|
|
||||||
this.entryDate = entryDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCustodyStatus()
|
|
||||||
{
|
|
||||||
return custodyStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCustodyStatus(String custodyStatus)
|
|
||||||
{
|
|
||||||
this.custodyStatus = custodyStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
@ -447,20 +265,6 @@ public class PsyUserProfile extends BaseEntity
|
||||||
.append("address", getAddress())
|
.append("address", getAddress())
|
||||||
.append("emergencyContact", getEmergencyContact())
|
.append("emergencyContact", getEmergencyContact())
|
||||||
.append("emergencyPhone", getEmergencyPhone())
|
.append("emergencyPhone", getEmergencyPhone())
|
||||||
.append("prisonerName", getPrisonerName())
|
|
||||||
.append("infoNumber", getInfoNumber())
|
|
||||||
.append("prisonName", getPrisonName())
|
|
||||||
.append("prisonAreaCode", getPrisonAreaCode())
|
|
||||||
.append("prisonAreaName", getPrisonAreaName())
|
|
||||||
.append("gender", getGender())
|
|
||||||
.append("nation", getNation())
|
|
||||||
.append("educationLevel", getEducationLevel())
|
|
||||||
.append("crimeName", getCrimeName())
|
|
||||||
.append("sentenceTerm", getSentenceTerm())
|
|
||||||
.append("sentenceStartDate", getSentenceStartDate())
|
|
||||||
.append("sentenceEndDate", getSentenceEndDate())
|
|
||||||
.append("entryDate", getEntryDate())
|
|
||||||
.append("custodyStatus", getCustodyStatus())
|
|
||||||
.append("createBy", getCreateBy())
|
.append("createBy", getCreateBy())
|
||||||
.append("createTime", getCreateTime())
|
.append("createTime", getCreateTime())
|
||||||
.append("updateBy", getUpdateBy())
|
.append("updateBy", getUpdateBy())
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@ import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.dao.DataAccessException;
|
import org.springframework.dao.DataAccessException;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.alibaba.fastjson2.JSON;
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import com.ddnai.common.core.domain.entity.SysUser;
|
import com.ddnai.common.core.domain.entity.SysUser;
|
||||||
import com.ddnai.common.exception.ServiceException;
|
import com.ddnai.common.exception.ServiceException;
|
||||||
import com.ddnai.common.utils.StringUtils;
|
import com.ddnai.common.utils.StringUtils;
|
||||||
|
|
@ -16,7 +14,6 @@ import com.ddnai.system.domain.psychology.PsyUserProfile;
|
||||||
import com.ddnai.system.mapper.psychology.PsyUserProfileMapper;
|
import com.ddnai.system.mapper.psychology.PsyUserProfileMapper;
|
||||||
import com.ddnai.system.service.ISysUserService;
|
import com.ddnai.system.service.ISysUserService;
|
||||||
import com.ddnai.system.service.psychology.IPsyUserProfileService;
|
import com.ddnai.system.service.psychology.IPsyUserProfileService;
|
||||||
import com.ddnai.system.service.psychology.PsychologyCustodyDictionary;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户档案扩展表 服务层实现
|
* 用户档案扩展表 服务层实现
|
||||||
|
|
@ -43,9 +40,7 @@ public class PsyUserProfileServiceImpl implements IPsyUserProfileService
|
||||||
@Override
|
@Override
|
||||||
public PsyUserProfile selectProfileById(Long profileId)
|
public PsyUserProfile selectProfileById(Long profileId)
|
||||||
{
|
{
|
||||||
PsyUserProfile profile = profileMapper.selectProfileById(profileId);
|
return profileMapper.selectProfileById(profileId);
|
||||||
hydrateProfile(profile);
|
|
||||||
return profile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -57,9 +52,7 @@ public class PsyUserProfileServiceImpl implements IPsyUserProfileService
|
||||||
@Override
|
@Override
|
||||||
public PsyUserProfile selectProfileByUserId(Long userId)
|
public PsyUserProfile selectProfileByUserId(Long userId)
|
||||||
{
|
{
|
||||||
PsyUserProfile profile = profileMapper.selectProfileByUserId(userId);
|
return profileMapper.selectProfileByUserId(userId);
|
||||||
hydrateProfile(profile);
|
|
||||||
return profile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -72,9 +65,7 @@ public class PsyUserProfileServiceImpl implements IPsyUserProfileService
|
||||||
@com.ddnai.common.annotation.DataScope(deptAlias = "d", userAlias = "u")
|
@com.ddnai.common.annotation.DataScope(deptAlias = "d", userAlias = "u")
|
||||||
public List<PsyUserProfile> selectProfileList(PsyUserProfile profile)
|
public List<PsyUserProfile> selectProfileList(PsyUserProfile profile)
|
||||||
{
|
{
|
||||||
List<PsyUserProfile> list = profileMapper.selectProfileList(profile);
|
return profileMapper.selectProfileList(profile);
|
||||||
list.forEach(this::hydrateProfile);
|
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -126,7 +117,6 @@ public class PsyUserProfileServiceImpl implements IPsyUserProfileService
|
||||||
log.info("验证通过,开始插入用户档案,userId: {}", userId);
|
log.info("验证通过,开始插入用户档案,userId: {}", userId);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
persistProfileData(profile);
|
|
||||||
int result = profileMapper.insertProfile(profile);
|
int result = profileMapper.insertProfile(profile);
|
||||||
log.info("用户档案创建成功,userId: {}, profileId: {}", userId, profile.getProfileId());
|
log.info("用户档案创建成功,userId: {}, profileId: {}", userId, profile.getProfileId());
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -221,7 +211,6 @@ public class PsyUserProfileServiceImpl implements IPsyUserProfileService
|
||||||
throw new ServiceException("用户已被删除,无法更新档案");
|
throw new ServiceException("用户已被删除,无法更新档案");
|
||||||
}
|
}
|
||||||
|
|
||||||
persistProfileData(profile);
|
|
||||||
return profileMapper.updateProfile(profile);
|
return profileMapper.updateProfile(profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -236,86 +225,5 @@ public class PsyUserProfileServiceImpl implements IPsyUserProfileService
|
||||||
{
|
{
|
||||||
return profileMapper.deleteProfileByIds(profileIds);
|
return profileMapper.deleteProfileByIds(profileIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void hydrateProfile(PsyUserProfile profile)
|
|
||||||
{
|
|
||||||
if (profile == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotEmpty(profile.getProfileData()))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
JSONObject json = JSON.parseObject(profile.getProfileData());
|
|
||||||
profile.setPrisonerName(json.getString("prisonerName"));
|
|
||||||
profile.setInfoNumber(json.getString("infoNumber"));
|
|
||||||
profile.setPrisonName(json.getString("prisonName"));
|
|
||||||
profile.setPrisonAreaCode(json.getString("prisonAreaCode"));
|
|
||||||
profile.setPrisonAreaName(resolveCustodyLabel(json.getString("prisonAreaCode"), json.getString("prisonAreaName")));
|
|
||||||
profile.setGender(json.getString("gender"));
|
|
||||||
profile.setNation(json.getString("nation"));
|
|
||||||
profile.setEducationLevel(json.getString("educationLevel"));
|
|
||||||
profile.setCrimeName(json.getString("crimeName"));
|
|
||||||
profile.setSentenceTerm(json.getString("sentenceTerm"));
|
|
||||||
profile.setSentenceStartDate(json.getString("sentenceStartDate"));
|
|
||||||
profile.setSentenceEndDate(json.getString("sentenceEndDate"));
|
|
||||||
profile.setEntryDate(json.getString("entryDate"));
|
|
||||||
profile.setCustodyStatus(json.getString("custodyStatus"));
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
log.warn("解析档案扩展字段失败,profileId: {}, data: {}", profile.getProfileId(), profile.getProfileData(), ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StringUtils.isEmpty(profile.getPrisonerName()))
|
|
||||||
{
|
|
||||||
profile.setPrisonerName(profile.getUserName());
|
|
||||||
}
|
|
||||||
if (StringUtils.isEmpty(profile.getPrisonAreaName()))
|
|
||||||
{
|
|
||||||
profile.setPrisonAreaName(resolveCustodyLabel(profile.getPrisonAreaCode(), null));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void persistProfileData(PsyUserProfile profile)
|
|
||||||
{
|
|
||||||
if (profile == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
JSONObject json = new JSONObject();
|
|
||||||
json.put("prisonerName", profile.getPrisonerName());
|
|
||||||
json.put("infoNumber", profile.getInfoNumber());
|
|
||||||
json.put("prisonName", profile.getPrisonName());
|
|
||||||
json.put("prisonAreaCode", profile.getPrisonAreaCode());
|
|
||||||
json.put("prisonAreaName", resolveCustodyLabel(profile.getPrisonAreaCode(), profile.getPrisonAreaName()));
|
|
||||||
json.put("gender", profile.getGender());
|
|
||||||
json.put("nation", profile.getNation());
|
|
||||||
json.put("educationLevel", profile.getEducationLevel());
|
|
||||||
json.put("crimeName", profile.getCrimeName());
|
|
||||||
json.put("sentenceTerm", profile.getSentenceTerm());
|
|
||||||
json.put("sentenceStartDate", profile.getSentenceStartDate());
|
|
||||||
json.put("sentenceEndDate", profile.getSentenceEndDate());
|
|
||||||
json.put("entryDate", profile.getEntryDate());
|
|
||||||
json.put("custodyStatus", profile.getCustodyStatus());
|
|
||||||
|
|
||||||
profile.setProfileData(json.toJSONString());
|
|
||||||
if (StringUtils.isNotEmpty(profile.getPrisonerName()))
|
|
||||||
{
|
|
||||||
profile.setUserName(profile.getPrisonerName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String resolveCustodyLabel(String code, String fallback)
|
|
||||||
{
|
|
||||||
String label = PsychologyCustodyDictionary.labelOf(code);
|
|
||||||
if (StringUtils.isNotEmpty(label))
|
|
||||||
{
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
return fallback;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
BIN
ry_xinli_2025-11-18_06-13-25_mysql_data_zwPIk.sql.zip
Normal file
BIN
ry_xinli_2025-11-18_06-13-25_mysql_data_zwPIk.sql.zip
Normal file
Binary file not shown.
|
|
@ -1,8 +1,8 @@
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 网站管理系统
|
VUE_APP_TITLE = 心理健康测评系统
|
||||||
|
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
||||||
# 管理系统/生产环境
|
# 管理系统/生产环境
|
||||||
VUE_APP_BASE_API = 'http://1.15.149.240:30081'
|
VUE_APP_BASE_API = '/api'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 网站管理系统
|
VUE_APP_TITLE = 心理健康测评系统
|
||||||
|
|
||||||
BABEL_ENV = production
|
BABEL_ENV = production
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
<meta name="renderer" content="webkit">
|
<meta name="renderer" content="webkit">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
<link rel="icon" href="<%= BASE_URL %>">
|
||||||
<title><%= webpackConfig.name %></title>
|
<title><%= webpackConfig.name %></title>
|
||||||
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
|
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
|
||||||
<style>
|
<style>
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ export function logout() {
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
export function getCodeImg() {
|
export function getCodeImg() {
|
||||||
return request({
|
return request({
|
||||||
url: 'http://1.15.149.240:30081/captchaImage',
|
url: '/api/captchaImage',
|
||||||
headers: {
|
headers: {
|
||||||
isToken: false
|
isToken: false
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
|
|
@ -1,10 +1,48 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||||
<el-form-item label="罪犯姓名" prop="userName">
|
<el-form-item label="用户名称" prop="userName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.userName"
|
v-model="queryParams.userName"
|
||||||
placeholder="请输入罪犯姓名"
|
placeholder="请输入用户名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户ID" prop="userId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.userId"
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="手机号码" prop="phone">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.phone"
|
||||||
|
placeholder="请输入手机号码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="用户状态" clearable>
|
||||||
|
<el-option label="正常" value="0" />
|
||||||
|
<el-option label="停用" value="1" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="档案类型" prop="profileType">
|
||||||
|
<el-select v-model="queryParams.profileType" placeholder="档案类型" clearable>
|
||||||
|
<el-option label="标准" value="standard" />
|
||||||
|
<el-option label="儿童" value="child" />
|
||||||
|
<el-option label="成人" value="adult" />
|
||||||
|
<el-option label="老年" value="senior" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="身份证号" prop="idCard">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.idCard"
|
||||||
|
placeholder="请输入身份证号"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
|
|
@ -22,9 +60,9 @@
|
||||||
plain
|
plain
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAddUser"
|
||||||
v-hasPermi="['psychology:profile:add']"
|
v-hasPermi="['psychology:profile:add']"
|
||||||
>新增档案</el-button>
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
|
|
@ -37,16 +75,6 @@
|
||||||
v-hasPermi="['psychology:profile:edit']"
|
v-hasPermi="['psychology:profile:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-user"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAddUser"
|
|
||||||
v-hasPermi="['system:user:add']"
|
|
||||||
>新增系统用户</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
|
|
@ -65,22 +93,30 @@
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="序号" align="center" prop="profileId" width="80" />
|
<el-table-column label="序号" align="center" prop="profileId" width="80" />
|
||||||
<el-table-column label="用户ID" align="center" prop="userId" width="100" />
|
<el-table-column label="用户ID" align="center" prop="userId" width="100" />
|
||||||
<el-table-column label="罪犯姓名" align="center" prop="prisonerName" width="140" />
|
<el-table-column label="档案类型" align="center" prop="profileType" width="120">
|
||||||
<el-table-column label="信息编号" align="center" prop="infoNumber" width="140" />
|
<template slot-scope="scope">
|
||||||
<el-table-column label="监狱" align="center" prop="prisonName" width="140" />
|
<span v-if="scope.row.profileType === 'standard'">标准</span>
|
||||||
<el-table-column label="监区" align="center" prop="prisonAreaName" width="180" />
|
<span v-else-if="scope.row.profileType === 'child'">儿童</span>
|
||||||
<el-table-column label="性别" align="center" prop="gender" width="80" />
|
<span v-else-if="scope.row.profileType === 'adult'">成人</span>
|
||||||
<el-table-column label="民族" align="center" prop="nation" width="110" />
|
<span v-else-if="scope.row.profileType === 'senior'">老年</span>
|
||||||
<el-table-column label="文化程度" align="center" prop="educationLevel" width="110" />
|
<span v-else>{{ scope.row.profileType }}</span>
|
||||||
<el-table-column label="罪名" align="center" prop="crimeName" width="140" />
|
</template>
|
||||||
<el-table-column label="刑期" align="center" prop="sentenceTerm" width="160" />
|
</el-table-column>
|
||||||
<el-table-column label="刑期起日" align="center" prop="sentenceStartDate" width="120" />
|
<el-table-column label="姓名" align="center" prop="userName" width="100" />
|
||||||
<el-table-column label="刑期止日" align="center" prop="sentenceEndDate" width="120" />
|
<el-table-column label="电话" align="center" prop="phone" width="120" />
|
||||||
<el-table-column label="入监时间" align="center" prop="entryDate" width="120" />
|
<el-table-column label="身份证号" align="center" prop="idCard" width="180" />
|
||||||
<el-table-column label="状态" align="center" prop="custodyStatus" width="110">
|
<el-table-column label="生日" align="center" prop="birthday" width="120">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="学历" align="center" prop="education" width="100" />
|
||||||
|
<el-table-column label="职业" align="center" prop="occupation" width="120" />
|
||||||
|
<el-table-column label="紧急联系人" align="center" prop="emergencyContact" width="120" />
|
||||||
|
<el-table-column label="紧急电话" align="center" prop="emergencyPhone" width="130" />
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.custodyStatus" size="mini">{{ scope.row.custodyStatus }}</el-tag>
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||||
<span v-else>-</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
|
@ -89,7 +125,7 @@
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleEditProfile(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['psychology:profile:edit']"
|
v-hasPermi="['psychology:profile:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
|
|
@ -117,120 +153,83 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="用户ID" prop="userId">
|
<el-form-item label="用户ID" prop="userId">
|
||||||
<el-input-number v-model="form.userId" :min="1" :disabled="form.profileId != undefined" style="width: 100%;" />
|
<el-input-number v-model="form.userId" :min="1" :disabled="form.profileId != undefined" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="罪犯姓名" prop="prisonerName">
|
<el-form-item label="档案类型" prop="profileType">
|
||||||
<el-input v-model="form.prisonerName" placeholder="请输入罪犯姓名" />
|
<el-select v-model="form.profileType" placeholder="请选择档案类型">
|
||||||
|
<el-option label="标准" value="standard" />
|
||||||
|
<el-option label="儿童" value="child" />
|
||||||
|
<el-option label="成人" value="adult" />
|
||||||
|
<el-option label="老年" value="senior" />
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="信息编号" prop="infoNumber">
|
<el-form-item label="姓名" prop="userName">
|
||||||
<el-input v-model="form.infoNumber" placeholder="请输入信息编号" />
|
<el-input v-model="form.userName" placeholder="请输入姓名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="监狱" prop="prisonName">
|
<el-form-item label="电话" prop="phone">
|
||||||
<el-input v-model="form.prisonName" placeholder="请输入监狱名称" />
|
<el-input v-model="form.phone" placeholder="请输入电话" maxlength="11" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item label="监区" prop="prisonAreaCode">
|
<el-row>
|
||||||
<Treeselect
|
<el-col :span="12">
|
||||||
v-model="form.prisonAreaCode"
|
<el-form-item label="身份证号" prop="idCard">
|
||||||
:options="custodyOptions"
|
<el-input v-model="form.idCard" placeholder="请输入身份证号" maxlength="18" />
|
||||||
:show-count="false"
|
</el-form-item>
|
||||||
:allow-parent="false"
|
</el-col>
|
||||||
:value-consists-of="'LEAF_PRIORITY'"
|
<el-col :span="12">
|
||||||
placeholder="请选择监区"
|
<el-form-item label="生日" prop="birthday">
|
||||||
@input="handleCustodyChange"
|
<el-date-picker
|
||||||
/>
|
v-model="form.birthday"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择生日"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="学历" prop="education">
|
||||||
|
<el-input v-model="form.education" placeholder="请输入学历" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="职业" prop="occupation">
|
||||||
|
<el-input v-model="form.occupation" placeholder="请输入职业" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="头像">
|
||||||
|
<el-input v-model="form.avatar" placeholder="请输入头像URL" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="地址" prop="address">
|
||||||
|
<el-input v-model="form.address" type="textarea" :rows="2" placeholder="请输入地址" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="性别" prop="gender">
|
<el-form-item label="紧急联系人" prop="emergencyContact">
|
||||||
<el-select v-model="form.gender" placeholder="请选择性别">
|
<el-input v-model="form.emergencyContact" placeholder="请输入紧急联系人" />
|
||||||
<el-option v-for="item in genderOptions" :key="item" :label="item" :value="item" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="民族" prop="nation">
|
<el-form-item label="紧急联系电话" prop="emergencyPhone">
|
||||||
<el-input v-model="form.nation" placeholder="请输入民族" />
|
<el-input v-model="form.emergencyPhone" placeholder="请输入紧急联系电话" maxlength="11" />
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="文化程度" prop="educationLevel">
|
|
||||||
<el-input v-model="form.educationLevel" placeholder="请输入文化程度" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="罪名" prop="crimeName">
|
|
||||||
<el-input v-model="form.crimeName" placeholder="请输入罪名" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="刑期" prop="sentenceTerm">
|
|
||||||
<el-input v-model="form.sentenceTerm" placeholder="请输入刑期描述" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="状态" prop="custodyStatus">
|
|
||||||
<el-select v-model="form.custodyStatus" placeholder="请选择状态">
|
|
||||||
<el-option v-for="item in custodyStatusOptions" :key="item" :label="item" :value="item" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="刑期起日" prop="sentenceStartDate">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.sentenceStartDate"
|
|
||||||
type="date"
|
|
||||||
placeholder="选择刑期起日"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="刑期止日" prop="sentenceEndDate">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.sentenceEndDate"
|
|
||||||
type="date"
|
|
||||||
placeholder="选择刑期止日"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="入监时间" prop="entryDate">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="form.entryDate"
|
|
||||||
type="date"
|
|
||||||
placeholder="选择入监时间"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="备注">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
|
@ -330,7 +329,6 @@ import { listProfile, getProfile, delProfile, addProfile, updateProfile } from "
|
||||||
import { listUser, getUser, addUser, updateUser, delUser, deptTreeSelect } from "@/api/system/user"
|
import { listUser, getUser, addUser, updateUser, delUser, deptTreeSelect } from "@/api/system/user"
|
||||||
import Treeselect from "@riophae/vue-treeselect"
|
import Treeselect from "@riophae/vue-treeselect"
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
|
||||||
import { getCustodyTreeOptions, findCustodyLabel } from "@/utils/custodyArea"
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "PsyUserProfile",
|
name: "PsyUserProfile",
|
||||||
|
|
@ -363,8 +361,6 @@ export default {
|
||||||
deptOptions: undefined,
|
deptOptions: undefined,
|
||||||
// 过滤掉已禁用部门树选项
|
// 过滤掉已禁用部门树选项
|
||||||
enabledDeptOptions: undefined,
|
enabledDeptOptions: undefined,
|
||||||
// 监区/班级选项
|
|
||||||
custodyOptions: JSON.parse(JSON.stringify(getCustodyTreeOptions())),
|
|
||||||
// 岗位选项
|
// 岗位选项
|
||||||
postOptions: [],
|
postOptions: [],
|
||||||
// 角色选项
|
// 角色选项
|
||||||
|
|
@ -377,28 +373,30 @@ export default {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
userName: undefined
|
userName: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
status: undefined,
|
||||||
|
profileType: undefined,
|
||||||
|
idCard: undefined,
|
||||||
|
deptId: undefined
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
genderOptions: ['男', '女', '未知'],
|
|
||||||
custodyStatusOptions: ['在押', '释放', '假释', '外出'],
|
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
userId: [
|
userId: [
|
||||||
{ required: true, message: "用户ID不能为空", trigger: "blur" }
|
{ required: true, message: "用户ID不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
prisonerName: [
|
profileType: [
|
||||||
{ required: true, message: "罪犯姓名不能为空", trigger: "blur" }
|
{ required: true, message: "档案类型不能为空", trigger: "change" }
|
||||||
],
|
],
|
||||||
infoNumber: [
|
userName: [
|
||||||
{ required: true, message: "信息编号不能为空", trigger: "blur" }
|
{ required: true, message: "姓名不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
prisonAreaCode: [
|
phone: [
|
||||||
{ required: true, message: "请选择监区", trigger: "change" }
|
{ required: true, message: "电话不能为空", trigger: "blur" },
|
||||||
],
|
{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号码", trigger: "blur" }
|
||||||
custodyStatus: [
|
|
||||||
{ required: true, message: "请选择状态", trigger: "change" }
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// 用户表单校验
|
// 用户表单校验
|
||||||
|
|
@ -463,20 +461,16 @@ export default {
|
||||||
profileId: undefined,
|
profileId: undefined,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
profileType: "standard",
|
profileType: "standard",
|
||||||
prisonerName: undefined,
|
avatar: undefined,
|
||||||
infoNumber: undefined,
|
idCard: undefined,
|
||||||
prisonName: undefined,
|
userName: undefined,
|
||||||
prisonAreaCode: undefined,
|
phone: undefined,
|
||||||
prisonAreaName: undefined,
|
birthday: undefined,
|
||||||
gender: undefined,
|
education: undefined,
|
||||||
nation: undefined,
|
occupation: undefined,
|
||||||
educationLevel: undefined,
|
address: undefined,
|
||||||
crimeName: undefined,
|
emergencyContact: undefined,
|
||||||
sentenceTerm: undefined,
|
emergencyPhone: undefined,
|
||||||
sentenceStartDate: undefined,
|
|
||||||
sentenceEndDate: undefined,
|
|
||||||
entryDate: undefined,
|
|
||||||
custodyStatus: undefined,
|
|
||||||
remark: undefined
|
remark: undefined
|
||||||
}
|
}
|
||||||
this.resetForm("form")
|
this.resetForm("form")
|
||||||
|
|
@ -590,34 +584,29 @@ export default {
|
||||||
this.open = true
|
this.open = true
|
||||||
this.title = "添加用户档案"
|
this.title = "添加用户档案"
|
||||||
},
|
},
|
||||||
handleEditProfile(row) {
|
/** 修改按钮操作 */
|
||||||
const profileId = row.profileId
|
handleUpdate(row) {
|
||||||
this.reset()
|
this.resetUserForm()
|
||||||
if (!profileId) {
|
const userId = row.userId || (this.ids.length > 0 ? this.ids[0] : null)
|
||||||
this.form.userId = row.userId
|
if (!userId) {
|
||||||
this.form.prisonerName = row.prisonerName || row.nickName || row.userName
|
this.$modal.msgError("请选择要修改的用户")
|
||||||
this.form.infoNumber = row.infoNumber
|
|
||||||
this.form.prisonName = row.prisonName
|
|
||||||
this.form.prisonAreaName = row.prisonAreaName
|
|
||||||
this.form.prisonAreaCode = row.prisonAreaCode
|
|
||||||
this.title = "添加用户档案"
|
|
||||||
this.open = true
|
|
||||||
this.$modal.msgWarning("该用户暂无档案,已切换到新增模式")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
getProfile(profileId).then(response => {
|
getUser(userId).then(response => {
|
||||||
const data = response.data || {}
|
this.userForm = response.data
|
||||||
this.form = Object.assign({}, this.form, data)
|
this.postOptions = response.posts
|
||||||
this.form.prisonAreaName = data.prisonAreaName
|
this.roleOptions = response.roles
|
||||||
this.title = "修改用户档案"
|
this.$set(this.userForm, "postIds", response.postIds)
|
||||||
this.open = true
|
this.$set(this.userForm, "roleIds", response.roleIds)
|
||||||
|
this.userOpen = true
|
||||||
|
this.userTitle = "修改用户"
|
||||||
|
this.userForm.password = ""
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.ensureCustodyLabel()
|
|
||||||
if (this.form.profileId != undefined) {
|
if (this.form.profileId != undefined) {
|
||||||
updateProfile(this.form).then(response => {
|
updateProfile(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功")
|
this.$modal.msgSuccess("修改成功")
|
||||||
|
|
@ -640,16 +629,6 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleCustodyChange(value) {
|
|
||||||
this.form.prisonAreaName = value ? findCustodyLabel(value) : undefined
|
|
||||||
},
|
|
||||||
ensureCustodyLabel() {
|
|
||||||
if (this.form.prisonAreaCode) {
|
|
||||||
this.form.prisonAreaName = findCustodyLabel(this.form.prisonAreaCode)
|
|
||||||
} else {
|
|
||||||
this.form.prisonAreaName = undefined
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const userIds = row.userId ? [row.userId] : this.ids
|
const userIds = row.userId ? [row.userId] : this.ids
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { scanQrcode } from "@/api/psychology/qrcode";
|
import { scanQrcode } from "@/api/psychology/qrcode";
|
||||||
import { getToken } from "@/utils/auth";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "QrcodeScan",
|
name: "QrcodeScan",
|
||||||
|
|
@ -134,19 +133,6 @@ export default {
|
||||||
|
|
||||||
// 如果是相对路径(以/开头),需要解析URL和查询参数
|
// 如果是相对路径(以/开头),需要解析URL和查询参数
|
||||||
if (relativePath.startsWith('/')) {
|
if (relativePath.startsWith('/')) {
|
||||||
// 对于报告下载接口,直接使用浏览器跳转,避免经过前端路由和权限控制
|
|
||||||
if (relativePath.startsWith('/psychology/report/publicDownload')) {
|
|
||||||
const finalUrl = targetUrl.startsWith('http://') || targetUrl.startsWith('https://')
|
|
||||||
? targetUrl
|
|
||||||
: window.location.origin + relativePath;
|
|
||||||
window.location.href = finalUrl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const normalizedRelativePath = relativePath;
|
|
||||||
if (!this.ensureLogin(normalizedRelativePath)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
// 解析URL,分离路径和查询参数
|
// 解析URL,分离路径和查询参数
|
||||||
const urlParts = relativePath.split('?');
|
const urlParts = relativePath.split('?');
|
||||||
|
|
@ -195,9 +181,6 @@ export default {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 其他情况,直接使用window.location
|
// 其他情况,直接使用window.location
|
||||||
if (!this.ensureLogin(relativePath)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
window.location.href = targetUrl;
|
window.location.href = targetUrl;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -208,45 +191,6 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('跳转地址不存在,请重新扫描二维码');
|
this.$message.warning('跳转地址不存在,请重新扫描二维码');
|
||||||
}
|
}
|
||||||
},
|
|
||||||
/** 判断当前二维码类型是否必须登录 */
|
|
||||||
shouldForceLogin() {
|
|
||||||
const type = this.getQrcodeType();
|
|
||||||
// 测评二维码必须登录;查看报告二维码改为直接下载,无需登录
|
|
||||||
return type === 'test';
|
|
||||||
},
|
|
||||||
/** 获取二维码类型(兼容多种字段命名) */
|
|
||||||
getQrcodeType() {
|
|
||||||
if (!this.qrcodeInfo) return '';
|
|
||||||
return (
|
|
||||||
this.qrcodeInfo.qrcodeType ||
|
|
||||||
this.qrcodeInfo.qrcode_type ||
|
|
||||||
this.qrcodeInfo.type ||
|
|
||||||
''
|
|
||||||
);
|
|
||||||
},
|
|
||||||
/** 检查是否已登录 */
|
|
||||||
hasValidToken() {
|
|
||||||
return !!getToken();
|
|
||||||
},
|
|
||||||
/** 引导到登录页面 */
|
|
||||||
goLogin(targetPath) {
|
|
||||||
const normalized = targetPath && targetPath.startsWith('/') ? targetPath : `/${targetPath || ''}`;
|
|
||||||
const encodedRedirect = encodeURIComponent(normalized);
|
|
||||||
const loginUrl = `/login?redirect=${encodedRedirect}`;
|
|
||||||
window.location.href = loginUrl;
|
|
||||||
},
|
|
||||||
/** 确保登录后再跳转 */
|
|
||||||
ensureLogin(targetPath) {
|
|
||||||
if (!this.shouldForceLogin()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (this.hasValidToken()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
this.$message.warning('请先登录学员账号后再继续操作');
|
|
||||||
this.goLogin(targetPath);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
* 作用:显示所有开放的心理测试题,学员可以选择进行测试
|
* 作用:显示所有开放的心理测试题,学员可以选择进行测试
|
||||||
*/
|
*/
|
||||||
import { listScale } from "@/api/psychology/scale"
|
import { listScale } from "@/api/psychology/scale"
|
||||||
import { startAssessment, myAssessmentList } from "@/api/psychology/assessment"
|
import { startAssessment } from "@/api/psychology/assessment"
|
||||||
import { Message } from 'element-ui'
|
import { Message } from 'element-ui'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -73,8 +73,7 @@ export default {
|
||||||
loading: false,
|
loading: false,
|
||||||
testList: [],
|
testList: [],
|
||||||
searchText: "",
|
searchText: "",
|
||||||
studentNo: "",
|
studentNo: ""
|
||||||
activeAssessmentMap: {} // 已存在的测评记录映射(按量表ID存储)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -94,8 +93,6 @@ export default {
|
||||||
this.studentNo = this.$store.getters.name || "未知"
|
this.studentNo = this.$store.getters.name || "未知"
|
||||||
// 加载测试题列表
|
// 加载测试题列表
|
||||||
this.loadTestList()
|
this.loadTestList()
|
||||||
// 加载当前用户未完成(测评中/已暂停)的测评记录
|
|
||||||
this.loadActiveAssessments()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 加载测试题列表
|
// 加载测试题列表
|
||||||
|
|
@ -117,35 +114,6 @@ export default {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 加载当前用户未完成或暂停的测评记录
|
|
||||||
loadActiveAssessments() {
|
|
||||||
// 取较大的 pageSize,避免遗漏
|
|
||||||
myAssessmentList({ pageNum: 1, pageSize: 1000 }).then(response => {
|
|
||||||
const rows = response.rows || []
|
|
||||||
const map = {}
|
|
||||||
rows.forEach(row => {
|
|
||||||
if (!row || !row.scaleId || !row.assessmentId) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// status: '0' = 测评中, '3' = 已暂停
|
|
||||||
if (row.status === '0' || row.status === '3') {
|
|
||||||
const existing = map[row.scaleId]
|
|
||||||
const currentTime = new Date(row.updateTime || row.createTime || 0).getTime()
|
|
||||||
const existTime = existing ? new Date(existing.updateTime || 0).getTime() : -Infinity
|
|
||||||
if (!existing || currentTime >= existTime) {
|
|
||||||
map[row.scaleId] = {
|
|
||||||
assessmentId: row.assessmentId,
|
|
||||||
status: row.status,
|
|
||||||
updateTime: row.updateTime || row.createTime
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.activeAssessmentMap = map
|
|
||||||
}).catch(error => {
|
|
||||||
console.error("loadActiveAssessments, 加载测评记录失败:", error)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 搜索处理
|
// 搜索处理
|
||||||
handleSearch() {
|
handleSearch() {
|
||||||
|
|
@ -170,17 +138,6 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果存在未完成/暂停的测评,直接跳转继续作答
|
|
||||||
const existingAssessment = this.activeAssessmentMap[test.scaleId]
|
|
||||||
if (existingAssessment && existingAssessment.assessmentId) {
|
|
||||||
Message.info("检测到未完成的测评,正在为您恢复进度")
|
|
||||||
this.$router.push({
|
|
||||||
path: '/psychology/assessment/taking',
|
|
||||||
query: { assessmentId: existingAssessment.assessmentId }
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果是量表,需要先创建测评
|
// 如果是量表,需要先创建测评
|
||||||
this.createAssessment(test)
|
this.createAssessment(test)
|
||||||
},
|
},
|
||||||
|
|
@ -206,12 +163,6 @@ export default {
|
||||||
// 后端返回格式:{ code: 200, msg: "操作成功", data: assessmentId }
|
// 后端返回格式:{ code: 200, msg: "操作成功", data: assessmentId }
|
||||||
if (response && response.code === 200 && response.data) {
|
if (response && response.code === 200 && response.data) {
|
||||||
const assessmentId = response.data
|
const assessmentId = response.data
|
||||||
// 记录该量表的测评ID,便于后续恢复
|
|
||||||
this.$set(this.activeAssessmentMap, test.scaleId, {
|
|
||||||
assessmentId,
|
|
||||||
status: '0',
|
|
||||||
updateTime: new Date().toISOString()
|
|
||||||
})
|
|
||||||
// 跳转到测评进行页面
|
// 跳转到测评进行页面
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/psychology/assessment/taking',
|
path: '/psychology/assessment/taking',
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,9 @@
|
||||||
<el-form-item label="用户名称" prop="userName">
|
<el-form-item label="用户名称" prop="userName">
|
||||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="手机号码" prop="phonenumber" v-if="false">
|
||||||
|
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-select v-model="queryParams.status" placeholder="用户状态" clearable style="width: 240px">
|
<el-select v-model="queryParams.status" placeholder="用户状态" clearable style="width: 240px">
|
||||||
<el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
<el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
|
|
@ -59,6 +62,7 @@
|
||||||
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns.userName.visible" :show-overflow-tooltip="true" />
|
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns.userName.visible" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns.nickName.visible" :show-overflow-tooltip="true" />
|
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns.nickName.visible" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns.deptName.visible" :show-overflow-tooltip="true" />
|
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns.deptName.visible" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="false" width="120" />
|
||||||
<el-table-column label="状态" align="center" key="status" v-if="columns.status.visible">
|
<el-table-column label="状态" align="center" key="status" v-if="columns.status.visible">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
|
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
|
||||||
|
|
@ -107,7 +111,7 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12" v-if="false">
|
||||||
<el-form-item label="手机号码" prop="phonenumber">
|
<el-form-item label="手机号码" prop="phonenumber">
|
||||||
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
|
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -279,6 +283,7 @@ export default {
|
||||||
userName: { label: '用户名称', visible: true },
|
userName: { label: '用户名称', visible: true },
|
||||||
nickName: { label: '用户昵称', visible: true },
|
nickName: { label: '用户昵称', visible: true },
|
||||||
deptName: { label: '部门', visible: true },
|
deptName: { label: '部门', visible: true },
|
||||||
|
phonenumber: { label: '手机号码', visible: false },
|
||||||
status: { label: '状态', visible: true },
|
status: { label: '状态', visible: true },
|
||||||
createTime: { label: '创建时间', visible: true }
|
createTime: { label: '创建时间', visible: true }
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ const name = process.env.VUE_APP_TITLE || '心理健康测评系统' // 网页
|
||||||
|
|
||||||
// 后端接口地址配置
|
// 后端接口地址配置
|
||||||
// 本地开发环境:使用 localhost:30081
|
// 本地开发环境:使用 localhost:30081
|
||||||
// 服务器环境:使用 http://1.15.149.240:30081
|
// 服务器环境:使用 http://****:30081
|
||||||
const baseUrl = process.env.NODE_ENV === 'development'
|
const baseUrl = process.env.NODE_ENV === 'development'
|
||||||
? 'http://localhost:30081' // 本地开发环境
|
? 'http://localhost:30081' // 本地开发环境
|
||||||
: 'http://1.15.149.240:30081' // 生产环境
|
: '/api' // 生产环境
|
||||||
|
|
||||||
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
npm install
|
|
||||||
npm run build
|
|
||||||
npm run dev
|
|
||||||
|
|
||||||
# 1.安装依赖,2.项目打包 3. 本机运行
|
|
||||||
Loading…
Reference in New Issue
Block a user