Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
site-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
site-project
Commits
298a324a
Commit
298a324a
authored
Feb 20, 2025
by
阳浪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
投稿统计
parent
69a3ae0d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
10 deletions
+72
-10
cloud-site-api/src/main/java/com/yizhi/site/application/feign/api/EventTrackApiClients.java
+3
-0
cloud-site-service/src/main/java/com/yizhi/site/application/controller/api/EventTrackController.java
+15
-10
cloud-site-service/src/main/java/com/yizhi/site/application/mapper/EventTrackMapper.java
+2
-0
cloud-site-service/src/main/java/com/yizhi/site/application/service/EventTrackService.java
+2
-0
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/EventTrackServiceImpl.java
+40
-0
cloud-site-service/src/main/resources/mapper/EventTrackMapper.xml
+10
-0
No files found.
cloud-site-api/src/main/java/com/yizhi/site/application/feign/api/EventTrackApiClients.java
View file @
298a324a
...
...
@@ -35,6 +35,9 @@ public interface EventTrackApiClients {
@GetMapping
(
"/api/eventTrack/queryDeptByType"
)
List
<
EventTrackDeptNumVo
>
queryDeptByType
(
@RequestParam
(
value
=
"date"
,
required
=
false
)
String
date
,
@RequestParam
(
"types"
)
List
<
Integer
>
types
);
@GetMapping
(
"/api/eventTrack/queryTgNumByDept"
)
List
<
EventTrackDeptNumVo
>
queryTgNumByDept
(
@RequestParam
(
value
=
"typeId"
,
required
=
false
)
Long
typeId
);
@GetMapping
(
"/api/eventTrack/queryListByType"
)
List
<
EventTrackVo
>
queryListByType
(
@RequestParam
(
"type"
)
Integer
type
,
@RequestParam
(
"accountId"
)
Long
accountId
);
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/controller/api/EventTrackController.java
View file @
298a324a
...
...
@@ -28,30 +28,35 @@ public class EventTrackController {
@GetMapping
(
"/api/eventTrack/addEvent"
)
public
void
addEvent
(
@RequestParam
(
"type"
)
String
type
,
@RequestParam
(
"businessId"
)
Long
businessId
){
eventTrackService
.
addEvent
(
type
,
businessId
);
public
void
addEvent
(
@RequestParam
(
"type"
)
String
type
,
@RequestParam
(
"businessId"
)
Long
businessId
)
{
eventTrackService
.
addEvent
(
type
,
businessId
);
}
@GetMapping
(
"/api/eventTrack/getTodayNum"
)
public
EventTrackDayNumVo
getTodayNum
(
@RequestParam
(
value
=
"date"
,
required
=
false
)
String
date
)
{
public
EventTrackDayNumVo
getTodayNum
(
@RequestParam
(
value
=
"date"
,
required
=
false
)
String
date
)
{
return
eventTrackService
.
getTodayNum
(
date
);
}
@GetMapping
(
"/api/eventTrack/getNumByType"
)
public
DayNumVo
getNumByType
(
@RequestParam
(
value
=
"date"
,
required
=
false
)
String
date
,
@RequestParam
(
"types"
)
List
<
Integer
>
types
)
{
return
eventTrackService
.
getNumByType
(
date
,
types
);
public
DayNumVo
getNumByType
(
@RequestParam
(
value
=
"date"
,
required
=
false
)
String
date
,
@RequestParam
(
"types"
)
List
<
Integer
>
types
)
{
return
eventTrackService
.
getNumByType
(
date
,
types
);
}
@GetMapping
(
"/api/eventTrack/queryNumByType"
)
public
List
<
EventTrackTypeNumVo
>
queryNumByType
(
@RequestParam
(
value
=
"date"
,
required
=
false
)
String
date
,
@RequestParam
(
"types"
)
List
<
Integer
>
types
,
@RequestParam
(
value
=
"subName"
,
required
=
false
)
String
subName
)
{
return
eventTrackService
.
queryNumByType
(
date
,
types
,
subName
);
public
List
<
EventTrackTypeNumVo
>
queryNumByType
(
@RequestParam
(
value
=
"date"
,
required
=
false
)
String
date
,
@RequestParam
(
"types"
)
List
<
Integer
>
types
,
@RequestParam
(
value
=
"subName"
,
required
=
false
)
String
subName
)
{
return
eventTrackService
.
queryNumByType
(
date
,
types
,
subName
);
}
@GetMapping
(
"/api/eventTrack/queryDeptByType"
)
public
List
<
EventTrackDeptNumVo
>
queryDeptByType
(
@RequestParam
(
value
=
"date"
,
required
=
false
)
String
date
,
@RequestParam
(
"types"
)
List
<
Integer
>
types
){
return
eventTrackService
.
queryDeptByType
(
date
,
types
);
public
List
<
EventTrackDeptNumVo
>
queryDeptByType
(
@RequestParam
(
value
=
"date"
,
required
=
false
)
String
date
,
@RequestParam
(
"types"
)
List
<
Integer
>
types
)
{
return
eventTrackService
.
queryDeptByType
(
date
,
types
);
}
@GetMapping
(
"/api/eventTrack/queryTgNumByDept"
)
public
List
<
EventTrackDeptNumVo
>
queryTgNumByDept
(
@RequestParam
(
value
=
"typeId"
,
required
=
false
)
Long
typeId
){
return
eventTrackService
.
queryTgNumByDept
(
typeId
);
}
@GetMapping
(
"/api/eventTrack/queryListByType"
)
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/mapper/EventTrackMapper.java
View file @
298a324a
...
...
@@ -25,6 +25,8 @@ public interface EventTrackMapper extends BaseMapper<EventTrack> {
List
<
EventTrackTypeNumVo
>
queryNumByType
(
@Param
(
"deptId"
)
Long
deptId
,
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"types"
)
List
<
Integer
>
types
,
@Param
(
"subNameList"
)
List
<
String
>
subNameList
);
List
<
EventTrackTypeNumVo
>
queryTgNumByDept
(
@Param
(
"deptName"
)
String
deptName
,
@Param
(
"typeId"
)
Long
typeId
);
List
<
EventTrackDeptNumVo
>
queryDeptByType
(
@Param
(
"date"
)
String
date
,
@Param
(
"dateString"
)
String
dateString
,
@Param
(
"types"
)
List
<
Integer
>
types
);
Integer
getNum
(
@Param
(
"type"
)
Integer
type
,
@Param
(
"businessId"
)
Long
businessId
);
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/service/EventTrackService.java
View file @
298a324a
...
...
@@ -30,6 +30,8 @@ public interface EventTrackService extends IService<EventTrack> {
List
<
EventTrackDeptNumVo
>
queryDeptByType
(
String
date
,
List
<
Integer
>
types
);
List
<
EventTrackDeptNumVo
>
queryTgNumByDept
(
Long
typeId
);
List
<
EventTrackVo
>
queryListByType
(
Integer
type
,
Long
accountId
);
Integer
getExamTotal
(
String
subType
,
String
year
);
...
...
cloud-site-service/src/main/java/com/yizhi/site/application/service/impl/EventTrackServiceImpl.java
View file @
298a324a
...
...
@@ -11,9 +11,11 @@ import com.yizhi.core.application.context.ContextHolder;
import
com.yizhi.core.application.context.RequestContext
;
import
com.yizhi.site.application.domain.DataClassification
;
import
com.yizhi.site.application.domain.EventTrack
;
import
com.yizhi.site.application.domain.Publication
;
import
com.yizhi.site.application.mapper.EventTrackMapper
;
import
com.yizhi.site.application.service.DataClassificationService
;
import
com.yizhi.site.application.service.EventTrackService
;
import
com.yizhi.site.application.service.PublicationService
;
import
com.yizhi.site.application.vo.domain.EventTrackVo
;
import
com.yizhi.site.application.vo.site.DayNumVo
;
import
com.yizhi.site.application.vo.site.EventTrackDayNumVo
;
...
...
@@ -54,6 +56,9 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
private
DataClassificationService
dataClassificationService
;
@Autowired
private
PublicationService
publicationService
;
@Autowired
IdGenerator
idGenerator
;
@Override
...
...
@@ -65,6 +70,9 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
userId
=
businessId
;
ContextHolder
.
get
().
setAccountId
(
userId
);
}
if
(
Objects
.
equals
(
type
,
"event_my_publication"
)){
Publication
publication
=
publicationService
.
publicationView
(
businessId
);
}
EventTrack
eventTrack
=
new
EventTrack
();
if
(
businessId
!=
null
){
DataClassification
dataClassification
=
dataClassificationService
.
selectById
(
businessId
);
...
...
@@ -266,6 +274,38 @@ public class EventTrackServiceImpl extends ServiceImpl<EventTrackMapper, EventTr
}
@Override
public
List
<
EventTrackDeptNumVo
>
queryTgNumByDept
(
Long
typeId
)
{
List
<
EventTrackDeptNumVo
>
eventTrackDeptNumVoList
=
this
.
baseMapper
.
queryGropByList
();
if
(
CollUtil
.
isNotEmpty
(
eventTrackDeptNumVoList
)){
eventTrackDeptNumVoList
.
stream
().
forEach
(
eventTrackDeptNumVo
->
{
List
<
EventTrackTypeNumVo
>
eventTrackTypeNumVoList
=
this
.
baseMapper
.
queryTgNumByDept
(
eventTrackDeptNumVo
.
getDeptName
(),
typeId
);
if
(
CollectionUtil
.
isNotEmpty
(
eventTrackTypeNumVoList
)){
List
<
EventTrackTypeNumVo
>
voList
=
Lists
.
newArrayList
();
eventTrackTypeNumVoList
.
stream
().
forEach
(
numVo
->{
Optional
<
EventTrackTypeNumVo
>
optional
=
voList
.
stream
().
filter
(
v
->
Objects
.
equals
(
v
.
getType
(),
numVo
.
getType
())).
findFirst
();
if
(
optional
!=
null
&&
optional
.
isPresent
()){
EventTrackTypeNumVo
vo
=
optional
.
get
();
if
(
numVo
.
getNum
()!=
null
)
{
if
(
vo
.
getNum
()!=
null
)
{
vo
.
setNum
(
numVo
.
getNum
()+
vo
.
getNum
());
}
else
{
vo
.
setNum
(
numVo
.
getNum
());
}
}
}
else
{
voList
.
add
(
numVo
);
}
});
eventTrackDeptNumVo
.
setEventTrackTypeNumVoList
(
voList
);
}
else
{
eventTrackDeptNumVo
.
setEventTrackTypeNumVoList
(
eventTrackTypeNumVoList
);
}
});
}
return
eventTrackDeptNumVoList
;
}
@Override
public
List
<
EventTrackVo
>
queryListByType
(
Integer
type
,
Long
accountId
)
{
EventTrack
eventTrack
=
new
EventTrack
();
eventTrack
.
setType
(
type
);
...
...
cloud-site-service/src/main/resources/mapper/EventTrackMapper.xml
View file @
298a324a
...
...
@@ -127,4 +127,13 @@
SELECT COUNT(DISTINCT create_by_id) FROM cloud_portal.event_track
WHERE sub_type =#{subType} and DATE_FORMAT(create_time,'%Y') = #{year}
</select>
<select
id=
"queryTgNumByDept"
resultType=
"com.yizhi.site.application.vo.site.EventTrackTypeNumVo"
>
select count(1) num ,DATE_FORMAT(create_time, '%m' ) subType from publication where dept_name=#{deptName}
<if
test=
"typeId!=null"
>
and type_one = #{typeId}
</if>
and create_time >= DATE_SUB(NOW(), INTERVAL 4 MONTH)
group by DATE_FORMAT( create_time, '%m' )
</select>
</mapper>
\ No newline at end of file
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