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
ba7b37ed
Commit
ba7b37ed
authored
Feb 12, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加评价人数
parent
d2ee6120
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
EvaluateManageApiServiceImpl.java
...uate/service/outer/impl/EvaluateManageApiServiceImpl.java
+19
-14
No files found.
gic-evaluate-service/src/main/java/com/gic/evaluate/service/outer/impl/EvaluateManageApiServiceImpl.java
View file @
ba7b37ed
...
...
@@ -15,10 +15,7 @@ import com.gic.evaluate.dto.EvaluateDTO;
import
com.gic.evaluate.dto.EvaluateQuickDTO
;
import
com.gic.evaluate.dto.EvaluateReplyDTO
;
import
com.gic.evaluate.dto.UserReplyDTO
;
import
com.gic.evaluate.entity.TabEvaluate
;
import
com.gic.evaluate.entity.TabEvaluateImg
;
import
com.gic.evaluate.entity.TabEvaluateQuick
;
import
com.gic.evaluate.entity.TabEvaluateReply
;
import
com.gic.evaluate.entity.*
;
import
com.gic.evaluate.qo.EvaluateQO
;
import
com.gic.evaluate.qo.StoreScoreQO
;
import
com.gic.evaluate.service.*
;
...
...
@@ -52,6 +49,9 @@ public class EvaluateManageApiServiceImpl implements EvaluateManageApiService {
private
EnterpriseApiService
enterpriseApiService
;
@Autowired
private
StoreApiService
storeApiService
;
@Autowired
private
EvaluateOrderConfigService
evaluateOrderConfigService
;
@Override
public
ServiceResponse
<
Page
<
EvaluateDTO
>>
listEvaluateForManage
(
EvaluateQO
evaluateQO
)
{
...
...
@@ -205,7 +205,10 @@ public class EvaluateManageApiServiceImpl implements EvaluateManageApiService {
List
<
EnterpriseDTO
>
enterpriseList
=
enterpriseApiService
.
listEnterpriseByName
(
null
).
getResult
();
List
<
Integer
>
enterpriseIds
=
Optional
.
ofNullable
(
enterpriseList
).
orElse
(
Collections
.
emptyList
()).
stream
().
map
(
EnterpriseDTO:
:
getEnterpriseId
).
collect
(
Collectors
.
toList
());
EvaluateQO
evaluateQO
=
new
EvaluateQO
();
evaluateQO
.
setMaliciousStatus
(
Constants
.
CLOSE
);
evaluateQO
.
setShowStatus
(
Constants
.
OPEN
);
for
(
Integer
enterpriseId
:
enterpriseIds
)
{
TabEvaluateOrderConfig
evaluateOrderConfig
=
this
.
evaluateOrderConfigService
.
getEvaluateOrderConfig
(
enterpriseId
);
StoreScoreQO
storeScoreQO
=
new
StoreScoreQO
();
storeScoreQO
.
setEnterpriseId
(
enterpriseId
);
storeScoreQO
.
setCurrentPage
(
1
);
...
...
@@ -214,28 +217,30 @@ public class EvaluateManageApiServiceImpl implements EvaluateManageApiService {
for
(
Map
<
String
,
Object
>
stringObjectMap
:
list
)
{
Object
goodsScore
=
stringObjectMap
.
get
(
"goodsScore"
);
Object
storeScore
=
stringObjectMap
.
get
(
"storeScore"
);
Object
serviceScore
=
stringObjectMap
.
get
(
"serviceScore"
)
.
toString
()
;
Object
serviceScore
=
stringObjectMap
.
get
(
"serviceScore"
);
int
count
=
0
;
double
sum
=
0
;
if
(
goodsScore
!=
null
)
{
if
(
Constants
.
OPEN
.
equals
(
evaluateOrderConfig
.
getGoods
())
&&
goodsScore
!=
null
)
{
count
++;
sum
+=
Double
.
valueOf
(
goodsScore
.
toString
());
}
if
(
storeScore
!=
null
)
{
if
(
Constants
.
OPEN
.
equals
(
evaluateOrderConfig
.
getStore
())
&&
storeScore
!=
null
)
{
count
++;
sum
+=
Double
.
valueOf
(
storeScore
.
toString
());
}
if
(
serviceScore
!=
null
)
{
if
(
Constants
.
OPEN
.
equals
(
evaluateOrderConfig
.
getService
())
&&
serviceScore
!=
null
)
{
count
++;
sum
+=
Double
.
valueOf
(
serviceScore
.
toString
());
}
Object
storeId
=
stringObjectMap
.
get
(
"storeId"
);
if
(
storeId
!=
null
)
{
Integer
storeIdInt
=
Integer
.
valueOf
(
storeId
.
toString
());
evaluateQO
.
setStoreIdList
(
Collections
.
singletonList
(
storeIdInt
));
Integer
evaluateCount
=
this
.
evaluateService
.
countEvaluate
(
evaluateQO
);
storeApiService
.
updateScore
(
enterpriseId
,
storeIdInt
,
sum
/
count
,
evaluateCount
);
if
(
count
>
0
)
{
Object
storeId
=
stringObjectMap
.
get
(
"storeId"
);
if
(
storeId
!=
null
)
{
Integer
storeIdInt
=
Integer
.
valueOf
(
storeId
.
toString
());
evaluateQO
.
setStoreIdList
(
Collections
.
singletonList
(
storeIdInt
));
Integer
evaluateCount
=
this
.
evaluateService
.
countEvaluate
(
evaluateQO
);
storeApiService
.
updateScore
(
enterpriseId
,
storeIdInt
,
sum
/
count
,
evaluateCount
);
}
}
}
}
...
...
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