Commit d2ee6120 by zhiwj

添加评价人数

parent 417b1656
......@@ -204,6 +204,7 @@ public class EvaluateManageApiServiceImpl implements EvaluateManageApiService {
public ServiceResponse<Integer> computeStoreScoreEvaluate(String msg) {
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();
for (Integer enterpriseId : enterpriseIds) {
StoreScoreQO storeScoreQO = new StoreScoreQO();
storeScoreQO.setEnterpriseId(enterpriseId);
......@@ -231,7 +232,10 @@ public class EvaluateManageApiServiceImpl implements EvaluateManageApiService {
}
Object storeId = stringObjectMap.get("storeId");
if (storeId != null) {
storeApiService.updateScore(enterpriseId, Integer.valueOf(storeId.toString()), sum / count);
Integer storeIdInt = Integer.valueOf(storeId.toString());
evaluateQO.setStoreIdList(Collections.singletonList(storeIdInt));
Integer evaluateCount = this.evaluateService.countEvaluate(evaluateQO);
storeApiService.updateScore(enterpriseId, storeIdInt, sum / count, evaluateCount);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment