Commit 3911fb52 authored by sunyuhua's avatar sunyuhua

项目Id不存在,避免null指针异常

parent 9bc0a6df
...@@ -56,7 +56,7 @@ public class CmptScoreRuleScoreInfoService { ...@@ -56,7 +56,7 @@ public class CmptScoreRuleScoreInfoService {
long userTotalScore=cmptScoreRuleScoreInfoList.stream().filter(entry -> entry.getSubsectionscore() != null).mapToInt(CmptScoreRuleScoreInfo::getSubsectionscore).sum(); long userTotalScore=cmptScoreRuleScoreInfoList.stream().filter(entry -> entry.getSubsectionscore() != null).mapToInt(CmptScoreRuleScoreInfo::getSubsectionscore).sum();
//计算里程之和 //计算里程之和
//int userTotalMileage=cmptScoreRuleScoreInfoList.stream().mapToInt(CmptScoreRuleScoreInfo::getSubsectionMileage).sum(); //int userTotalMileage=cmptScoreRuleScoreInfoList.stream().mapToInt(CmptScoreRuleScoreInfo::getSubsectionMileage).sum();
int userTotalMileage=Optional.of(cmptScoreRuleScoreInfoList).orElse(cmptScoreRuleScoreInfoList).stream().filter(entry -> entry.getSubsectionMileage() != null).mapToInt(CmptScoreRuleScoreInfo::getSubsectionMileage).sum(); int userTotalMileage=Optional.of(cmptScoreRuleScoreInfoList).orElse(cmptScoreRuleScoreInfoList).stream().filter(entry -> entry.getSubsectionMileage() != 0).mapToInt(CmptScoreRuleScoreInfo::getSubsectionMileage).sum();
HashMap<String,Object> userScore=new HashMap<>(); HashMap<String,Object> userScore=new HashMap<>();
userScore.put("userTotalScore",userTotalScore); userScore.put("userTotalScore",userTotalScore);
userScore.put("userTotalMileage",Integer.valueOf(userTotalMileage)); userScore.put("userTotalMileage",Integer.valueOf(userTotalMileage));
......
...@@ -583,6 +583,7 @@ public class RemoteService { ...@@ -583,6 +583,7 @@ public class RemoteService {
log.info("计时打卡点:" + resultString); log.info("计时打卡点:" + resultString);
JSONObject object = JSONObject.parseObject(resultString); JSONObject object = JSONObject.parseObject(resultString);
JSONObject roadJsonObject=object.getJSONObject("road"); JSONObject roadJsonObject=object.getJSONObject("road");
if(roadJsonObject == null || roadJsonObject.isEmpty()) return null;
JSONArray segsResult = roadJsonObject.getJSONArray("segs"); JSONArray segsResult = roadJsonObject.getJSONArray("segs");
if(segsResult == null || segsResult.isEmpty()) return null; if(segsResult == null || segsResult.isEmpty()) return null;
//支持多日赛 //支持多日赛
......
spring.profiles.active=dev spring.profiles.active=test
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