Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-analysis
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.online.exam
pica-cloud-analysis
提交
c6cbb182
提交
c6cbb182
编写于
8月 29, 2018
作者:
minghao.wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: chc单独调用sql和普通的活动区分开
上级
4b557400
变更
4
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
67 行增加
和
110 行删除
+67
-110
AnalysisController.java
...e/exam/analysis/server/controller/AnalysisController.java
+31
-94
CHCAnalysisMapper.java
...online/exam/analysis/server/mapper/CHCAnalysisMapper.java
+2
-0
CHCAnalysisServiceImpl.java
.../analysis/server/service/impl/CHCAnalysisServiceImpl.java
+26
-16
CHCAnalysisMapper.xml
server/src/main/resources/mybatis/CHCAnalysisMapper.xml
+8
-0
未找到文件。
server/src/main/java/com/pica/cloud/online/exam/analysis/server/controller/AnalysisController.java
浏览文件 @
c6cbb182
...
@@ -152,35 +152,13 @@ public class AnalysisController {
...
@@ -152,35 +152,13 @@ public class AnalysisController {
examTitleReplyDto
.
setReplyStatus
(
0
);
examTitleReplyDto
.
setReplyStatus
(
0
);
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
Doctor
doctor
=
doctorService
.
getDoctorById
(
user
.
getId
());
examTitleReplyDto
.
setReplyStatus
(
getReplyStatus
(
examTitleId
,
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
()));
}
}
}
}
}
/**
/**
* TODO: 测试用
* TODO: 测试用
*/
*/
examTitleReplyDto
.
setReplyStatus
(
analysisService
.
getReplyStatus
(
examTitleId
,
user
.
getId
()
));
examTitleReplyDto
.
setReplyStatus
(
analysisService
.
getReplyStatus
(
examTitleId
,
user
!=
null
?
user
.
getId
()
:
0
));
builder
.
setData
(
examTitleReplyDto
);
builder
.
setData
(
examTitleReplyDto
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -223,29 +201,7 @@ public class AnalysisController {
...
@@ -223,29 +201,7 @@ public class AnalysisController {
examTitleReplyDetailDto
.
setReplyStatus
(
0
);
examTitleReplyDetailDto
.
setReplyStatus
(
0
);
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
Doctor
doctor
=
doctorService
.
getDoctorById
(
user
.
getId
());
examTitleReplyDetailDto
.
setReplyStatus
(
getReplyStatus
(
reply
.
getAnalysisRoundExamTitleId
(),
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
);
builder
.
setData
(
examTitleReplyDetailDto
);
...
@@ -391,31 +347,8 @@ public class AnalysisController {
...
@@ -391,31 +347,8 @@ public class AnalysisController {
* 设置回复状态
* 设置回复状态
*/
*/
examTitleReplyDto
.
setReplyStatus
(
0
);
examTitleReplyDto
.
setReplyStatus
(
0
);
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
Doctor
doctor
=
doctorService
.
getDoctorById
(
user
.
getId
());
examTitleReplyDto
.
setReplyStatus
(
getReplyStatus
(
examTitleId
,
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
);
builder
.
setData
(
examTitleReplyDto
);
...
@@ -460,29 +393,7 @@ public class AnalysisController {
...
@@ -460,29 +393,7 @@ public class AnalysisController {
examTitleReplyDetailDto
.
setReplyStatus
(
0
);
examTitleReplyDetailDto
.
setReplyStatus
(
0
);
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
if
(
user
!=
null
&&
user
.
getId
()
!=
0
)
{
Doctor
doctor
=
doctorService
.
getDoctorById
(
user
.
getId
());
examTitleReplyDetailDto
.
setReplyStatus
(
getReplyStatus
(
reply
.
getAnalysisRoundExamTitleId
(),
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
);
builder
.
setData
(
examTitleReplyDetailDto
);
...
@@ -545,4 +456,30 @@ public class AnalysisController {
...
@@ -545,4 +456,30 @@ public class AnalysisController {
picaResponse
.
setData
(
""
);
picaResponse
.
setData
(
""
);
return
picaResponse
;
return
picaResponse
;
}
}
Integer
getReplyStatus
(
Integer
examTitleId
,
Integer
userId
)
{
Doctor
doctor
=
doctorService
.
getDoctorById
(
userId
);
if
(
doctor
!=
null
)
{
CHCAnalysis
analysis
=
analysisService
.
getAnalysisById
(
examTitleId
);
if
(
analysis
.
getType
()
==
1
)
{
/**
* CHC 获取考试前两百名
*/
if
(
rankingListService
.
isRankingInTop200
(
doctor
.
getId
()))
{
return
analysisService
.
getReplyStatus
(
examTitleId
,
userId
);
}
}
else
if
(
analysis
.
getType
()
==
2
)
{
/**
* PSA 职务职称主任/副主任 院长/副院长 科长/副科长 管理人数100以上
*/
if
(
doctorService
.
isAuth
(
doctor
.
getId
()))
{
return
analysisService
.
getReplyStatus
(
examTitleId
,
userId
);
}
}
}
return
0
;
}
}
}
server/src/main/java/com/pica/cloud/online/exam/analysis/server/mapper/CHCAnalysisMapper.java
浏览文件 @
c6cbb182
...
@@ -11,6 +11,8 @@ public interface CHCAnalysisMapper {
...
@@ -11,6 +11,8 @@ public interface CHCAnalysisMapper {
CHCAnalysis
selectByPrimaryKey
(
Integer
id
);
CHCAnalysis
selectByPrimaryKey
(
Integer
id
);
CHCAnalysis
selectCHCByPrimaryKey
(
Integer
id
);
CHCAnalysis
selectPSAByPrimaryKey
(
Integer
id
);
CHCAnalysis
selectPSAByPrimaryKey
(
Integer
id
);
int
updateByPrimaryKeySelective
(
CHCAnalysis
record
);
int
updateByPrimaryKeySelective
(
CHCAnalysis
record
);
...
...
server/src/main/java/com/pica/cloud/online/exam/analysis/server/service/impl/CHCAnalysisServiceImpl.java
浏览文件 @
c6cbb182
...
@@ -53,7 +53,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -53,7 +53,7 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
@Override
@Override
public
CHCAnalysisDto
getCHCAnalysisDtoById
(
Integer
analysisId
)
{
public
CHCAnalysisDto
getCHCAnalysisDtoById
(
Integer
analysisId
)
{
CHCAnalysis
analysis
=
analysisMapper
.
selectByPrimaryKey
(
analysisId
);
CHCAnalysis
analysis
=
analysisMapper
.
select
CHC
ByPrimaryKey
(
analysisId
);
if
(
null
==
analysis
)
{
if
(
null
==
analysis
)
{
return
null
;
return
null
;
}
}
...
@@ -189,30 +189,33 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -189,30 +189,33 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
/**
/**
* 设置选项
* 设置选项
*/
*/
if
(
analysisRoundExamTitle
.
getConfig
()
!=
null
)
{
List
<
String
>
configList
=
new
ArrayList
<>();
List
<
String
>
configList
=
new
ArrayList
<>();
String
[]
configArr
=
analysisRoundExamTitle
.
getConfig
().
split
(
"\\$\\{answer\\}"
);
String
[]
configArr
=
analysisRoundExamTitle
.
getConfig
().
split
(
"\\$\\{answer\\}"
);
for
(
int
idx
=
0
;
idx
<
configArr
.
length
;
++
idx
)
{
for
(
int
idx
=
0
;
idx
<
configArr
.
length
;
++
idx
)
{
configList
.
add
(
OPTIONS
[
idx
]
+
"."
+
configArr
[
idx
]);
configList
.
add
(
OPTIONS
[
idx
]
+
"."
+
configArr
[
idx
]);
}
}
examTitleDto
.
setConfig
(
configList
);
examTitleDto
.
setConfig
(
configList
);
}
/**
/**
* 设置答案
* 设置答案
*/
*/
if
(
analysisRoundExamTitle
.
getAnswer
()
!=
null
)
{
examTitleDto
.
setAnswer
(
analysisRoundExamTitle
.
getAnswer
());
examTitleDto
.
setAnswer
(
analysisRoundExamTitle
.
getAnswer
());
String
[]
answerArr
=
analysisRoundExamTitle
.
getAnswer
().
split
(
","
);
String
[]
answerArr
=
analysisRoundExamTitle
.
getAnswer
().
split
(
","
);
List
<
Integer
>
idxList
=
new
ArrayList
<>();
List
<
Integer
>
idxList
=
new
ArrayList
<>();
for
(
String
sa
:
answerArr
)
{
for
(
String
sa
:
answerArr
)
{
for
(
int
i
=
0
;
i
<
8
;
++
i
)
{
for
(
int
i
=
0
;
i
<
8
;
++
i
)
{
if
(
sa
.
equals
(
OPTIONS
[
i
]))
{
if
(
sa
.
equals
(
OPTIONS
[
i
]))
{
idxList
.
add
(
i
);
idxList
.
add
(
i
);
}
}
}
}
}
}
examTitleDto
.
setAnswerIdx
(
StringUtils
.
join
(
idxList
,
","
));
examTitleDto
.
setAnswerIdx
(
StringUtils
.
join
(
idxList
,
","
));
}
examTitleDto
.
setErrorRate
(
analysisRoundExamTitle
.
getErrorRate
());
examTitleDto
.
setErrorRate
(
analysisRoundExamTitle
.
getErrorRate
());
examTitleDto
.
setStarCount
(
starRecordMapper
.
selectStarCountByRoundExamTitleId
(
analysisRoundExamTitle
.
getId
()));
examTitleDto
.
setStarCount
(
starRecordMapper
.
selectStarCountByRoundExamTitleId
(
analysisRoundExamTitle
.
getId
()));
examTitleDto
.
setReplyCount
(
replyMapper
.
selectReplyCountByAnalysisRoundExamTitleId
(
analysisRoundExamTitle
.
getId
()));
examTitleDto
.
setReplyCount
(
replyMapper
.
selectReplyCountByAnalysisRoundExamTitleId
(
analysisRoundExamTitle
.
getId
()));
...
@@ -424,6 +427,13 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
...
@@ -424,6 +427,13 @@ public class CHCAnalysisServiceImpl implements CHCAnalysisService {
@Override
@Override
public
Integer
getReplyStatus
(
Integer
examTitleId
,
Integer
userId
)
{
public
Integer
getReplyStatus
(
Integer
examTitleId
,
Integer
userId
)
{
/**
* 用户不存在
*/
if
(
userId
==
0
)
{
return
0
;
}
Reply
reply
=
new
Reply
();
Reply
reply
=
new
Reply
();
reply
.
setAnalysisRoundExamTitleId
(
examTitleId
);
reply
.
setAnalysisRoundExamTitleId
(
examTitleId
);
reply
.
setUserId
(
userId
);
reply
.
setUserId
(
userId
);
...
...
server/src/main/resources/mybatis/CHCAnalysisMapper.xml
浏览文件 @
c6cbb182
...
@@ -27,6 +27,14 @@
...
@@ -27,6 +27,14 @@
is_deleted
is_deleted
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from p_chc_analysis
where id = #{id,jdbcType=INTEGER}
and is_deleted = 0
</select>
<select
id=
"selectCHCByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from p_chc_analysis
from p_chc_analysis
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录