提交 18f04a54 编写于 作者: minghao.wu's avatar minghao.wu

fix: 反垃圾信息返回格式化,在详情页面中增加replyStatus字段

上级 0fd20b2b
......@@ -217,6 +217,37 @@ public class AnalysisController {
examTitleReplyDetailDto.setExamTitle(examTitleDto);
examTitleReplyDetailDto.setReply(replyDto);
/**
* 设置回复状态
*/
examTitleReplyDetailDto.setReplyStatus(0);
if (user != null && user.getId() != 0) {
Doctor doctor = doctorService.getDoctorById(user.getId());
examTitleReplyDetailDto.setReplyStatus(analysisService.getReplyStatus(reply.getAnalysisRoundExamTitleId(), user.getId()));
if (doctor != null) {
CHCAnalysis analysis = analysisService.getAnalysisById(analysisRoundExamTitle.getAnalysisId());
if (analysis.getType() == 1) {
/**
* CHC 获取考试前两百名
*/
if (rankingListService.isRankingInTop200(doctor.getId())) {
examTitleReplyDetailDto.setReplyStatus(analysisService.getReplyStatus(reply.getAnalysisRoundExamTitleId(), user.getId()));
}
} else if (analysis.getType() == 2) {
/**
* PSA 职务职称主任/副主任 院长/副院长 科长/副科长 管理人数100以上
*/
if (doctorService.isAuth(doctor.getId())) {
examTitleReplyDetailDto.setReplyStatus(analysisService.getReplyStatus(reply.getAnalysisRoundExamTitleId(), user.getId()));
}
}
}
}
builder.setData(examTitleReplyDetailDto);
} catch (Exception e) {
e.printStackTrace();
......@@ -355,6 +386,37 @@ public class AnalysisController {
examTitleReplyDto.setExamTitle(examTitleDto);
examTitleReplyDto.setReplyList(replyDtoList);
/**
* 设置回复状态
*/
examTitleReplyDto.setReplyStatus(0);
if (user != null && user.getId() != 0) {
Doctor doctor = doctorService.getDoctorById(user.getId());
examTitleReplyDto.setReplyStatus(analysisService.getReplyStatus(examTitleId, user.getId()));
if (doctor != null) {
CHCAnalysis analysis = analysisService.getAnalysisById(analysisRoundExamTitle.getAnalysisId());
if (analysis.getType() == 1) {
/**
* CHC 获取考试前两百名
*/
if (rankingListService.isRankingInTop200(doctor.getId())) {
examTitleReplyDto.setReplyStatus(analysisService.getReplyStatus(examTitleId, user.getId()));
}
} else if (analysis.getType() == 2) {
/**
* PSA 职务职称主任/副主任 院长/副院长 科长/副科长 管理人数100以上
*/
if (doctorService.isAuth(doctor.getId())) {
examTitleReplyDto.setReplyStatus(analysisService.getReplyStatus(examTitleId, user.getId()));
}
}
}
}
builder.setData(examTitleReplyDto);
} catch (Exception e) {
e.printStackTrace();
......@@ -391,6 +453,37 @@ public class AnalysisController {
examTitleReplyDetailDto.setExamTitle(examTitleDto);
examTitleReplyDetailDto.setReply(replyDto);
/**
* 设置回复状态
*/
examTitleReplyDetailDto.setReplyStatus(0);
if (user != null && user.getId() != 0) {
Doctor doctor = doctorService.getDoctorById(user.getId());
examTitleReplyDetailDto.setReplyStatus(analysisService.getReplyStatus(reply.getAnalysisRoundExamTitleId(), user.getId()));
if (doctor != null) {
CHCAnalysis analysis = analysisService.getAnalysisById(analysisRoundExamTitle.getAnalysisId());
if (analysis.getType() == 1) {
/**
* CHC 获取考试前两百名
*/
if (rankingListService.isRankingInTop200(doctor.getId())) {
examTitleReplyDetailDto.setReplyStatus(analysisService.getReplyStatus(reply.getAnalysisRoundExamTitleId(), user.getId()));
}
} else if (analysis.getType() == 2) {
/**
* PSA 职务职称主任/副主任 院长/副院长 科长/副科长 管理人数100以上
*/
if (doctorService.isAuth(doctor.getId())) {
examTitleReplyDetailDto.setReplyStatus(analysisService.getReplyStatus(reply.getAnalysisRoundExamTitleId(), user.getId()));
}
}
}
}
builder.setData(examTitleReplyDetailDto);
} catch (Exception e) {
e.printStackTrace();
......
package com.pica.cloud.online.exam.analysis.server.service.impl;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.pica.cloud.foundation.entity.PicaResponse;
......@@ -98,7 +99,23 @@ public class AntiSpamServiceImpl implements AntiSpamService {
/**
* TODO: 可以进一步处理 显示信息被过滤原因
*/
return ReturnUtil.getPicaResponse(PicaResultCode.DATA_IS_WRONG, "");
for (JsonElement labelElement : labelArray) {
JsonObject lObject = labelElement.getAsJsonObject();
int label = lObject.get("label").getAsInt();
int level = lObject.get("level").getAsInt();
JsonObject detailsObject=lObject.getAsJsonObject("details");
JsonArray hintArray=detailsObject.getAsJsonArray("hint");
if (label == 100) msg = "输入内容包含色情词汇,请修改后重新输入";
else if (label == 200) msg = "输入内容包含广告词汇,请修改后重新输入";
else if (label == 400) msg = "输入内容包含违禁词汇,请修改后重新输入";
else if (label == 500) msg = "输入内容包含涉政词汇,请修改后重新输入";
else if (label == 600) msg = "输入内容包含谩骂词汇,请修改后重新输入";
else if (label == 700) msg = "输入内容包含灌水词汇,请修改后重新输入";
return ReturnUtil.getPicaResponse("400002", msg);
}
}
} else {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册