Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-evaluate
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-evaluate
Commits
8174429d
Commit
8174429d
authored
Feb 20, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加评价率
parent
90aa3680
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
2 deletions
+54
-2
TabEvaluateMsgLogMapper.java
.../com/gic/evaluate/dao/mapper/TabEvaluateMsgLogMapper.java
+5
-0
EvaluateMsgLogService.java
.../java/com/gic/evaluate/service/EvaluateMsgLogService.java
+3
-0
EvaluateMsgLogServiceImpl.java
.../gic/evaluate/service/impl/EvaluateMsgLogServiceImpl.java
+7
-0
EvaluateOverviewApiServiceImpl.java
...te/service/outer/impl/EvaluateOverviewApiServiceImpl.java
+24
-2
TabEvaluateMsgLogMapper.xml
...ice/src/main/resources/mapper/TabEvaluateMsgLogMapper.xml
+15
-0
No files found.
gic-evaluate-service/src/main/java/com/gic/evaluate/dao/mapper/TabEvaluateMsgLogMapper.java
View file @
8174429d
package
com
.
gic
.
evaluate
.
dao
.
mapper
;
import
com.gic.evaluate.entity.TabEvaluateMsgLog
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
public
interface
TabEvaluateMsgLogMapper
{
/**
...
...
@@ -63,4 +65,6 @@ public interface TabEvaluateMsgLogMapper {
List
<
TabEvaluateMsgLog
>
listReviewMsgLogs
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"startTimeOfDay"
)
Date
startTimeOfDay
,
@Param
(
"endTimeOfDay"
)
Date
endTimeOfDay
);
@MapKey
(
"storeId"
)
Map
<
Integer
,
Map
<
String
,
Object
>>
orderCountByStoreId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
,
@Param
(
"ids"
)
List
<
Integer
>
storeIdList
);
}
\ No newline at end of file
gic-evaluate-service/src/main/java/com/gic/evaluate/service/EvaluateMsgLogService.java
View file @
8174429d
...
...
@@ -3,6 +3,7 @@ package com.gic.evaluate.service;
import
com.gic.evaluate.entity.TabEvaluateMsgLog
;
import
java.util.List
;
import
java.util.Map
;
/**
*
...
...
@@ -22,4 +23,6 @@ public interface EvaluateMsgLogService {
List
<
TabEvaluateMsgLog
>
listReviewMsgLogs
(
Integer
enterpriseId
);
void
update
(
TabEvaluateMsgLog
log
);
Map
<
Integer
,
Map
<
String
,
Object
>>
orderCountByStoreId
(
Integer
enterpriseId
,
List
<
Integer
>
storeIdList
);
}
gic-evaluate-service/src/main/java/com/gic/evaluate/service/impl/EvaluateMsgLogServiceImpl.java
View file @
8174429d
...
...
@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
*
...
...
@@ -50,4 +51,9 @@ public class EvaluateMsgLogServiceImpl implements EvaluateMsgLogService {
public
void
update
(
TabEvaluateMsgLog
log
)
{
tabEvaluateMsgLogMapper
.
updateByPrimaryKeySelective
(
log
);
}
@Override
public
Map
<
Integer
,
Map
<
String
,
Object
>>
orderCountByStoreId
(
Integer
enterpriseId
,
List
<
Integer
>
storeIdList
)
{
return
tabEvaluateMsgLogMapper
.
orderCountByStoreId
(
enterpriseId
,
storeIdList
);
}
}
\ No newline at end of file
gic-evaluate-service/src/main/java/com/gic/evaluate/service/outer/impl/EvaluateOverviewApiServiceImpl.java
View file @
8174429d
...
...
@@ -9,6 +9,7 @@ import com.gic.enterprise.response.EnterpriseServiceResponse;
import
com.gic.evaluate.constant.QuickReplyTypeEnum
;
import
com.gic.evaluate.qo.StoreScoreQO
;
import
com.gic.evaluate.qo.StoreTrendQO
;
import
com.gic.evaluate.service.EvaluateMsgLogService
;
import
com.gic.evaluate.service.EvaluateOverviewApiService
;
import
com.gic.evaluate.service.EvaluateService
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
@@ -35,6 +36,8 @@ public class EvaluateOverviewApiServiceImpl implements EvaluateOverviewApiServic
@Autowired
private
EvaluateService
evaluateService
;
@Autowired
private
EvaluateMsgLogService
evaluateMsgLogService
;
@Override
public
ServiceResponse
<
Map
<
String
,
Long
>>
chart1
(
Integer
enterpriseId
,
String
startTime
,
String
endTime
,
List
<
Integer
>
storeIdList
)
{
...
...
@@ -118,12 +121,31 @@ public class EvaluateOverviewApiServiceImpl implements EvaluateOverviewApiServic
if
(
CollectionUtils
.
isNotEmpty
(
trendList
))
{
List
<
Integer
>
storeIdList
=
trendList
.
stream
().
map
(
e
->
{
e
.
put
(
"evaluateRate"
,
0
);
//
e.put("evaluateRate", 0);
Object
storeId
=
e
.
get
(
"storeId"
);
return
storeId
==
null
?
null
:
Integer
.
valueOf
(
storeId
.
toString
());
}
).
collect
(
Collectors
.
toList
());
// todo order 通过storeIdList拿到order总数
Map
<
Integer
,
Map
<
String
,
Object
>>
orderCountMap
=
evaluateMsgLogService
.
orderCountByStoreId
(
storeTrendQO
.
getEnterpriseId
(),
storeIdList
);
for
(
Map
<
String
,
Object
>
e
:
trendList
)
{
// e.put("evaluateRate", 0);
Object
storeId
=
e
.
get
(
"storeId"
);
if
(
storeId
!=
null
)
{
Map
<
String
,
Object
>
map
=
orderCountMap
.
get
(
Integer
.
valueOf
(
storeId
.
toString
()));
if
(
map
!=
null
)
{
Long
totalCount
=
(
Long
)
e
.
get
(
"totalCount"
);
Long
orderCount
=
(
Long
)
map
.
get
(
"orderCount"
);
if
(
orderCount
!=
null
&&
orderCount
!=
0
)
{
e
.
put
(
"evaluateRate"
,
totalCount
.
doubleValue
()
/
orderCount
.
doubleValue
());
}
else
{
e
.
put
(
"evaluateRate"
,
0
);
}
}
else
{
e
.
put
(
"evaluateRate"
,
0
);
}
}
}
}
return
EnterpriseServiceResponse
.
success
(
PageHelperUtils
.
changePageHelperToCurrentPage
(
trendList
));
}
...
...
gic-evaluate-service/src/main/resources/mapper/TabEvaluateMsgLogMapper.xml
View file @
8174429d
...
...
@@ -302,4 +302,18 @@
<include
refid=
"Base_Column_List"
/>
from tab_evaluate_msg_log where enterprise_id = #{enterpriseId} and review_send_time
>
= #{startTimeOfDay} and review_send_time
<
= #{endTimeOfDay} and review_status = 1
</select>
<select
id=
"orderCountByStoreId"
resultType=
"map"
>
select
store_id storeId,
count(*) orderCount
from tab_evaluate_msg_log
where enterprise_id = #{enterpriseId}
<if
test=
"null != ids"
>
and store_id in
<foreach
collection=
"ids"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
group by store_id
</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