Showing
2 changed files
with
41 additions
and
14 deletions
@@ -91,10 +91,12 @@ public class ReportController { | @@ -91,10 +91,12 @@ public class ReportController { | ||
91 | reportDetail.setStatus(detail.getStatus()); | 91 | reportDetail.setStatus(detail.getStatus()); |
92 | 92 | ||
93 | XklAmpReportMetaItemsEntity metaItems=Constants.itemMetaMap.get(itemId); | 93 | XklAmpReportMetaItemsEntity metaItems=Constants.itemMetaMap.get(itemId); |
94 | - reportDetail.setTitle(metaItems.getTitle()); | ||
95 | - reportDetail.setNormal(metaItems.getStandardLowMale()+" - "+metaItems.getStandardHighMale()); | ||
96 | - reportDetail.setNormalNv(metaItems.getStandardLowFemale()+ " - "+metaItems.getStandardHighFemale()); | ||
97 | - reportDetail.setType(metaItems.getType()); | 94 | + if(metaItems!=null){ |
95 | + reportDetail.setTitle(metaItems.getTitle()); | ||
96 | + reportDetail.setNormal(metaItems.getStandardLowMale()+" - "+metaItems.getStandardHighMale()); | ||
97 | + reportDetail.setNormalNv(metaItems.getStandardLowFemale()+ " - "+metaItems.getStandardHighFemale()); | ||
98 | + reportDetail.setType(metaItems.getType()); | ||
99 | + } | ||
98 | 100 | ||
99 | XklAmpReportHealthScoreEntity scoreEntity = xklAmpReportHealthScoreRespository.findByReportIdAndType(report_id,metaItems.getType()); | 101 | XklAmpReportHealthScoreEntity scoreEntity = xklAmpReportHealthScoreRespository.findByReportIdAndType(report_id,metaItems.getType()); |
100 | if(scoreEntity!=null) | 102 | if(scoreEntity!=null) |
@@ -137,16 +139,21 @@ public class ReportController { | @@ -137,16 +139,21 @@ public class ReportController { | ||
137 | 139 | ||
138 | XklAmpReportMetaItemsEntity metaItems = Constants.itemMetaMap.get(itemId); | 140 | XklAmpReportMetaItemsEntity metaItems = Constants.itemMetaMap.get(itemId); |
139 | String result=""; | 141 | String result=""; |
140 | - //0, normal,1, lower,2, higher | ||
141 | - if(status == 0){ | ||
142 | - result = metaItems.getExplainNormal(); | ||
143 | - }else if(status == 1){ | ||
144 | - result = metaItems.getExplainLow(); | ||
145 | - }else if(status == 2){ | ||
146 | - result = metaItems.getExplainHigh(); | 142 | + if(metaItems!= null){ |
143 | + //0, normal,1, lower,2, higher | ||
144 | + if(status == 0){ | ||
145 | + result = metaItems.getExplainNormal(); | ||
146 | + }else if(status == 1){ | ||
147 | + result = metaItems.getExplainLow(); | ||
148 | + }else if(status == 2){ | ||
149 | + result = metaItems.getExplainHigh(); | ||
150 | + }else{ | ||
151 | + result = "没有此status相关信息"; | ||
152 | + } | ||
147 | }else{ | 153 | }else{ |
148 | - result = "没有此status相关信息"; | 154 | + result = "没有此itemId相关信息"; |
149 | } | 155 | } |
156 | + | ||
150 | return new ResponseEntity<>(ResultModel.ok(result), HttpStatus.OK); | 157 | return new ResponseEntity<>(ResultModel.ok(result), HttpStatus.OK); |
151 | } | 158 | } |
152 | 159 | ||
@@ -174,8 +181,10 @@ public class ReportController { | @@ -174,8 +181,10 @@ public class ReportController { | ||
174 | long reportId= report.getId(); | 181 | long reportId= report.getId(); |
175 | if(reportTime>=stimeLong&&reportTime<=etimeLong){//在时间范围内 | 182 | if(reportTime>=stimeLong&&reportTime<=etimeLong){//在时间范围内 |
176 | XklAmpReportDetailEntity reportDetail = xklAmpReportDetailRespository.findByReportIdAndItemId(reportId,itemId); | 183 | XklAmpReportDetailEntity reportDetail = xklAmpReportDetailRespository.findByReportIdAndItemId(reportId,itemId); |
177 | - ReportItemGraphModel reportItemGraphModel= new ReportItemGraphModel(reportTime,reportDetail.getItemValue()); | ||
178 | - reportItemGraphModelList.add(reportItemGraphModel); | 184 | + if(reportDetail!=null){ |
185 | + ReportItemGraphModel reportItemGraphModel= new ReportItemGraphModel(reportTime,reportDetail.getItemValue()); | ||
186 | + reportItemGraphModelList.add(reportItemGraphModel); | ||
187 | + } | ||
179 | } | 188 | } |
180 | } | 189 | } |
181 | } | 190 | } |
src/main/resources/application.properties
0 → 100644
1 | +server.port=8090 | ||
2 | + | ||
3 | +#server.ssl.key-store = ${user.home}/.keystore | ||
4 | +#server.ssl.key-store-password = xkl2016 | ||
5 | +#server.ssl.key-password = xkl2016 | ||
6 | + | ||
7 | +#MySQL | ||
8 | +spring.datasource.url=jdbc:mysql://localhost:3306/hanhe_test?useUnicode=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=round&autoReconnect=true | ||
9 | +spring.datasource.username=root | ||
10 | +spring.datasource.password=fyqmysql | ||
11 | + | ||
12 | +#Redis | ||
13 | +spring.redis.host=127.0.0.1 | ||
14 | +spring.redis.password=foobared | ||
15 | +#spring.redis.host=r-m5e7cedd3124afd4.redis.rds.aliyuncs.com | ||
16 | +#spring.redis.password=r-m5e7cedd3124afd4:XIkaiLURedis2016 | ||
17 | + | ||
18 | +spring.redis.port=6379 |
-
Please register or login to post a comment