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
7bfded67
Commit
7bfded67
authored
Dec 04, 2024
by
梅存智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查看调研详情接口
parent
c41299d4
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
76 additions
and
0 deletions
+76
-0
cloud-research-api/src/main/java/com/yizhi/research/application/feign/ResearchClient.java
+9
-0
cloud-research-service/src/main/java/com/yizhi/research/application/controller/ResearchController.java
+11
-0
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/ResearchMapper.java
+9
-0
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/ResearchMapper.xml
+27
-0
cloud-research-service/src/main/java/com/yizhi/research/application/service/IResearchService.java
+7
-0
cloud-research-service/src/main/java/com/yizhi/research/application/service/impl/ResearchServiceImpl.java
+13
-0
No files found.
cloud-research-api/src/main/java/com/yizhi/research/application/feign/ResearchClient.java
View file @
7bfded67
...
@@ -217,6 +217,15 @@ public interface ResearchClient {
...
@@ -217,6 +217,15 @@ public interface ResearchClient {
*/
*/
@GetMapping
(
"/research/top/get"
)
@GetMapping
(
"/research/top/get"
)
List
<
ResearchVo
>
getResearchTop
(
@RequestParam
(
"bizType"
)
Integer
bizType
);
List
<
ResearchVo
>
getResearchTop
(
@RequestParam
(
"bizType"
)
Integer
bizType
);
/**
* 查看研信详情
*
* @param id
* @return
*/
@GetMapping
(
"/research/details"
)
ResearchVo
getResearchDetails
(
@RequestParam
(
"id"
)
Long
id
);
}
}
cloud-research-service/src/main/java/com/yizhi/research/application/controller/ResearchController.java
View file @
7bfded67
...
@@ -408,5 +408,16 @@ public class ResearchController {
...
@@ -408,5 +408,16 @@ public class ResearchController {
List
<
ResearchVo
>
getResearchTop
(
@RequestParam
(
"bizType"
)
Integer
bizType
){
List
<
ResearchVo
>
getResearchTop
(
@RequestParam
(
"bizType"
)
Integer
bizType
){
return
researchService
.
getResearchTop
(
bizType
);
return
researchService
.
getResearchTop
(
bizType
);
}
}
/**
* 查看调研详情
*
* @param id
* @return
*/
@GetMapping
(
"/details"
)
ResearchVo
getResearchDetails
(
@RequestParam
(
"id"
)
Long
id
)
{
return
researchService
.
getResearchDetails
(
id
);
}
}
}
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/ResearchMapper.java
View file @
7bfded67
...
@@ -120,4 +120,13 @@ public interface ResearchMapper extends BaseMapper<Research> {
...
@@ -120,4 +120,13 @@ public interface ResearchMapper extends BaseMapper<Research> {
* @return
* @return
*/
*/
List
<
ResearchVo
>
getResearchTop
(
@Param
(
"bizType"
)
Integer
bizType
,
@Param
(
"siteId"
)
Long
siteId
);
List
<
ResearchVo
>
getResearchTop
(
@Param
(
"bizType"
)
Integer
bizType
,
@Param
(
"siteId"
)
Long
siteId
);
/**
* 查看调研详情
* @param id
* @param siteId
* @param accountId
* @return
*/
ResearchVo
selectResearchDetails
(
@Param
(
"id"
)
Long
id
,
@Param
(
"accountId"
)
Long
accountId
,
@Param
(
"siteId"
)
Long
siteId
);
}
}
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/ResearchMapper.xml
View file @
7bfded67
...
@@ -565,4 +565,31 @@
...
@@ -565,4 +565,31 @@
from research tb
from research tb
where tb.site_id = #{siteId} and tb.biz_type = #{bizType} and tb.state = 1 and tb.top_up = 1 and tb.deleted = 0
where tb.site_id = #{siteId} and tb.biz_type = #{bizType} and tb.state = 1 and tb.top_up = 1 and tb.deleted = 0
</select>
</select>
<select
id=
"selectResearchDetails"
resultType=
"com.yizhi.research.application.vo.domain.ResearchVo"
>
select answer.submit_time as submitTime,
CASE WHEN
<![CDATA[ tb.start_time > NOW() ]]>
THEN 0 ELSE
CASE WHEN
<![CDATA[ tb.start_time >= NOW() ]]>
AND answerf.finish IS NULL THEN 4 ELSE
CASE WHEN answerf.finish=1 THEN 1 ELSE
CASE WHEN
<![CDATA[ tb.end_time < NOW() ]]>
THEN 3 ELSE
2
END
END
END
END AS finishState
,tb.id AS id
,answer.submit_time as finishTime
,tb.research_no AS researchNo
,tb.name AS name
,tb.start_time AS startTime
,tb.end_time AS endTime
,tb.content AS content
,tb.remark
,tb.image
from research tb
left join tr_research_answer answer on answer.research_id = tb.id and answer.account_id = #{accountId} and answer.finish=1
left join tr_research_answer answerf on answer.research_id = tb.id and answerf.account_id = #{accountId} and answerf.finish in(0,1)
where tb.id=#{id} and tb.deleted = 0 and tb.site_id = #{siteId}
group by tb.id
</select>
</mapper>
</mapper>
cloud-research-service/src/main/java/com/yizhi/research/application/service/IResearchService.java
View file @
7bfded67
...
@@ -153,4 +153,11 @@ public interface IResearchService extends IService<Research> {
...
@@ -153,4 +153,11 @@ public interface IResearchService extends IService<Research> {
* @return
* @return
*/
*/
List
<
ResearchVo
>
getResearchTop
(
Integer
bizType
);
List
<
ResearchVo
>
getResearchTop
(
Integer
bizType
);
/**
* 查看调研详情
* @param id
* @return
*/
ResearchVo
getResearchDetails
(
Long
id
);
}
}
cloud-research-service/src/main/java/com/yizhi/research/application/service/impl/ResearchServiceImpl.java
View file @
7bfded67
...
@@ -859,4 +859,17 @@ public class ResearchServiceImpl extends ServiceImpl<ResearchMapper, Research> i
...
@@ -859,4 +859,17 @@ public class ResearchServiceImpl extends ServiceImpl<ResearchMapper, Research> i
Long
siteId
=
requestContext
.
getSiteId
();
Long
siteId
=
requestContext
.
getSiteId
();
return
researchMapper
.
getResearchTop
(
bizType
,
siteId
);
return
researchMapper
.
getResearchTop
(
bizType
,
siteId
);
}
}
@Override
public
ResearchVo
getResearchDetails
(
Long
id
)
{
RequestContext
requestContext
=
ContextHolder
.
get
();
if
(
requestContext
==
null
){
return
null
;
}
ResearchVo
research
=
researchMapper
.
selectResearchDetails
(
id
,
requestContext
.
getAccountId
(),
requestContext
.
getSiteId
());
return
research
;
}
}
}
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