Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
research-project
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
research-project
Commits
bfdb7bfc
Commit
bfdb7bfc
authored
Dec 20, 2024
by
梅存智
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
投票次数根据投票状态设置 See merge request
!4
parents
721486a8
6c1f05ee
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
8 deletions
+31
-8
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/ResearchMapper.java
+2
-2
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/ResearchMapper.xml
+6
-2
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/TrResearchAnswerMapper.java
+2
-0
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/TrResearchAnswerMapper.xml
+4
-0
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/TrResearchQuestionMapper.xml
+2
-0
cloud-research-service/src/main/java/com/yizhi/research/application/service/impl/ResearchServiceImpl.java
+7
-3
cloud-research-service/src/main/java/com/yizhi/research/application/service/impl/TrResearchQuestionServiceImpl.java
+8
-1
No files found.
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/ResearchMapper.java
View file @
bfdb7bfc
...
@@ -34,9 +34,9 @@ public interface ResearchMapper extends BaseMapper<Research> {
...
@@ -34,9 +34,9 @@ public interface ResearchMapper extends BaseMapper<Research> {
* @param rowBounds
* @param rowBounds
* @return
* @return
*/
*/
List
<
Research
>
listPage
(
@Param
(
"date"
)
String
date
,
@Param
(
"state"
)
Integer
state
,
@Param
(
"name"
)
String
name
,
@Param
(
"range"
)
DataRangeModel
dataRangeModel
,
RowBounds
rowBounds
);
List
<
Research
>
listPage
(
@Param
(
"date"
)
String
date
,
@Param
(
"state"
)
Integer
state
,
@Param
(
"name"
)
String
name
,
@Param
(
"
bizType"
)
Integer
bizType
,
@Param
(
"
range"
)
DataRangeModel
dataRangeModel
,
RowBounds
rowBounds
);
Integer
listPageCount
(
@Param
(
"date"
)
String
date
,
@Param
(
"state"
)
Integer
state
,
@Param
(
"name"
)
String
name
,
@Param
(
"range"
)
DataRangeModel
dataRangeModel
);
Integer
listPageCount
(
@Param
(
"date"
)
String
date
,
@Param
(
"state"
)
Integer
state
,
@Param
(
"name"
)
String
name
,
@Param
(
"
bizType"
)
Integer
bizType
,
@Param
(
"
range"
)
DataRangeModel
dataRangeModel
);
/**
/**
* 查询所有
* 查询所有
...
...
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/ResearchMapper.xml
View file @
bfdb7bfc
...
@@ -300,7 +300,9 @@
...
@@ -300,7 +300,9 @@
<if
test=
"name != null"
>
<if
test=
"name != null"
>
and (tb.name like concat('%', #{name}, '%') or tb.keywords like concat('%', #{name}, '%') )
and (tb.name like concat('%', #{name}, '%') or tb.keywords like concat('%', #{name}, '%') )
</if>
</if>
<if
test=
"bizType != null"
>
and tb.biz_type = #{bizType}
</if>
<!--
<!--
<if test="range.admin == false and range.orgIds != null and range.orgIds.size > 0">
<if test="range.admin == false and range.orgIds != null and range.orgIds.size > 0">
...
@@ -329,7 +331,9 @@
...
@@ -329,7 +331,9 @@
<if
test=
"name != null"
>
<if
test=
"name != null"
>
and (tb.name like concat('%', #{name}, '%') or tb.keywords like concat('%', #{name}, '%') )
and (tb.name like concat('%', #{name}, '%') or tb.keywords like concat('%', #{name}, '%') )
</if>
</if>
<if
test=
"bizType != null"
>
and tb.biz_type = #{bizType}
</if>
<!--
<!--
<if test="range.admin == false and range.orgIds != null and range.orgIds.size > 0">
<if test="range.admin == false and range.orgIds != null and range.orgIds.size > 0">
...
...
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/TrResearchAnswerMapper.java
View file @
bfdb7bfc
...
@@ -56,4 +56,6 @@ public interface TrResearchAnswerMapper extends BaseMapper<TrResearchAnswer> {
...
@@ -56,4 +56,6 @@ public interface TrResearchAnswerMapper extends BaseMapper<TrResearchAnswer> {
List
<
ResearchGroupViewVo
>
queryAnswerRecord
(
@Param
(
"researchId"
)
Long
researchId
,
@Param
(
"siteId"
)
Long
siteId
);
List
<
ResearchGroupViewVo
>
queryAnswerRecord
(
@Param
(
"researchId"
)
Long
researchId
,
@Param
(
"siteId"
)
Long
siteId
);
List
<
Long
>
getFinshIdsByIds
(
@Param
(
"ids"
)
List
<
Long
>
ids
,
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"siteId"
)
Long
siteId
);
List
<
Long
>
getFinshIdsByIds
(
@Param
(
"ids"
)
List
<
Long
>
ids
,
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"siteId"
)
Long
siteId
);
Integer
getResearchAnsweFinish
(
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"researchId"
)
Long
researchId
);
}
}
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/TrResearchAnswerMapper.xml
View file @
bfdb7bfc
...
@@ -115,4 +115,8 @@
...
@@ -115,4 +115,8 @@
</if>
</if>
</select>
</select>
<select
id=
"getResearchAnsweFinish"
resultType=
"Integer"
>
SELECT MAX(a.finish) AS finish FROM tr_research_answer a
where a.research_id = #{researchId} and a.account_id = #{accountId} and a.finish = 1
</select>
</mapper>
</mapper>
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/TrResearchQuestionMapper.xml
View file @
bfdb7bfc
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
<resultMap
id=
"getVoteResultMap"
type=
"com.yizhi.research.application.vo.domain.VoteRankingVo"
>
<resultMap
id=
"getVoteResultMap"
type=
"com.yizhi.research.application.vo.domain.VoteRankingVo"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"voteNum"
column=
"vote_num"
/>
<collection
property=
"rankingList"
ofType=
"com.yizhi.research.application.vo.domain.VoteRankingListVo"
>
<collection
property=
"rankingList"
ofType=
"com.yizhi.research.application.vo.domain.VoteRankingListVo"
>
<result
property=
"id"
column=
"questionId"
/>
<result
property=
"id"
column=
"questionId"
/>
<result
property=
"no"
column=
"no"
/>
<result
property=
"no"
column=
"no"
/>
...
@@ -179,6 +180,7 @@
...
@@ -179,6 +180,7 @@
<if
test=
"isTop == null or isTop == false"
>
<if
test=
"isTop == null or isTop == false"
>
,IFNULL(myanswer.answerState,0) AS answerState
,IFNULL(myanswer.answerState,0) AS answerState
</if>
</if>
,r.vote_num
FROM tr_research_question a
FROM tr_research_question a
INNER JOIN tr_research_question_option b ON a.id=b.question_id AND b.deleted=0
INNER JOIN tr_research_question_option b ON a.id=b.question_id AND b.deleted=0
LEFT JOIN tr_research_answer_question_result c ON c.option_id=b.id
LEFT JOIN tr_research_answer_question_result c ON c.option_id=b.id
...
...
cloud-research-service/src/main/java/com/yizhi/research/application/service/impl/ResearchServiceImpl.java
View file @
bfdb7bfc
...
@@ -126,6 +126,7 @@ public class ResearchServiceImpl extends ServiceImpl<ResearchMapper, Research> i
...
@@ -126,6 +126,7 @@ public class ResearchServiceImpl extends ServiceImpl<ResearchMapper, Research> i
HQueryUtil
.
startHQ
(
Research
.
class
);
HQueryUtil
.
startHQ
(
Research
.
class
);
Integer
state
=
null
;
Integer
state
=
null
;
String
name
=
null
;
String
name
=
null
;
Integer
bizType
=
null
;
if
(!
StringUtils
.
isEmpty
(
map
.
get
(
"state"
)))
{
if
(!
StringUtils
.
isEmpty
(
map
.
get
(
"state"
)))
{
state
=
(
Integer
)
map
.
get
(
"state"
);
state
=
(
Integer
)
map
.
get
(
"state"
);
...
@@ -133,6 +134,9 @@ public class ResearchServiceImpl extends ServiceImpl<ResearchMapper, Research> i
...
@@ -133,6 +134,9 @@ public class ResearchServiceImpl extends ServiceImpl<ResearchMapper, Research> i
if
(!
StringUtils
.
isEmpty
(
map
.
get
(
"name"
)))
{
if
(!
StringUtils
.
isEmpty
(
map
.
get
(
"name"
)))
{
name
=
(
String
)
map
.
get
(
"name"
);
name
=
(
String
)
map
.
get
(
"name"
);
}
}
if
(!
StringUtils
.
isEmpty
(
map
.
get
(
"bizType"
)))
{
bizType
=
(
Integer
)
map
.
get
(
"bizType"
);
}
//为过滤过期调研准备
//为过滤过期调研准备
String
date
=
null
;
String
date
=
null
;
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
...
@@ -155,8 +159,8 @@ public class ResearchServiceImpl extends ServiceImpl<ResearchMapper, Research> i
...
@@ -155,8 +159,8 @@ public class ResearchServiceImpl extends ServiceImpl<ResearchMapper, Research> i
}
}
Page
<
Research
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
Page
<
Research
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
page
.
setTotal
(
researchMapper
.
listPageCount
(
date
,
state
,
name
,
dataRangeModel
));
page
.
setTotal
(
researchMapper
.
listPageCount
(
date
,
state
,
name
,
bizType
,
dataRangeModel
));
page
.
setRecords
(
researchMapper
.
listPage
(
date
,
state
,
name
,
dataRangeModel
,
new
RowBounds
(
page
.
getOffset
(),
page
.
getLimit
())));
page
.
setRecords
(
researchMapper
.
listPage
(
date
,
state
,
name
,
bizType
,
dataRangeModel
,
new
RowBounds
(
page
.
getOffset
(),
page
.
getLimit
())));
return
page
;
return
page
;
}
}
...
@@ -870,7 +874,7 @@ public class ResearchServiceImpl extends ServiceImpl<ResearchMapper, Research> i
...
@@ -870,7 +874,7 @@ public class ResearchServiceImpl extends ServiceImpl<ResearchMapper, Research> i
ResearchVo
research
=
researchMapper
.
selectResearchDetails
(
id
,
requestContext
.
getAccountId
(),
requestContext
.
getSiteId
());
ResearchVo
research
=
researchMapper
.
selectResearchDetails
(
id
,
requestContext
.
getAccountId
(),
requestContext
.
getSiteId
());
//投票完成或过期选择次数0
//投票完成或过期选择次数0
if
(
research
.
getFinishState
()
==
1
||
research
.
getFinishState
()
==
2
){
if
(
research
.
getFinishState
()
==
1
||
research
.
getFinishState
()
==
3
){
research
.
setVoteNum
(
0
);
research
.
setVoteNum
(
0
);
}
}
...
...
cloud-research-service/src/main/java/com/yizhi/research/application/service/impl/TrResearchQuestionServiceImpl.java
View file @
bfdb7bfc
...
@@ -1019,7 +1019,14 @@ public class TrResearchQuestionServiceImpl extends ServiceImpl<TrResearchQuestio
...
@@ -1019,7 +1019,14 @@ public class TrResearchQuestionServiceImpl extends ServiceImpl<TrResearchQuestio
RequestContext
context
=
ContextHolder
.
get
();
RequestContext
context
=
ContextHolder
.
get
();
Long
companyId
=
context
.
getCompanyId
();
Long
companyId
=
context
.
getCompanyId
();
Long
siteId
=
context
.
getSiteId
();
Long
siteId
=
context
.
getSiteId
();
return
researchQuestionMapper
.
getVoteResult
(
companyId
,
siteId
,
researchId
,
context
.
getAccountId
(),
false
);
VoteRankingVo
voteRankingVo
=
researchQuestionMapper
.
getVoteResult
(
companyId
,
siteId
,
researchId
,
context
.
getAccountId
(),
false
);
if
(
voteRankingVo
!=
null
){
Integer
finish
=
trResearchAnswerMapper
.
getResearchAnsweFinish
(
context
.
getAccountId
(),
researchId
);
if
(
finish
!=
null
&&
finish
==
1
){
voteRankingVo
.
setVoteNum
(
0
);
}
}
return
voteRankingVo
;
}
}
@Override
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment