Commit 57225d648b6f72631f962147c03c1b80b07697b4

Authored by jiangjiazhi
1 parent 4b4fa76b5b

增加设置parentid

Showing 1 changed file with 61 additions and 50 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 57225d6
... ... @@ -228,59 +228,22 @@
228 228 */
229 229 public HighScoreResult findLastRisk(String parentId,boolean needLevel) {
230 230 List<AntenatalExaminationModel> list = antenatalExaminationService.findAllByParentId(parentId);
231   - AntenatalExaminationModel model = null;
232   - if (CollectionUtils.isNotEmpty(list)) {
233   - model = list.get(0);
234   - }
235 231 HighScoreResult highScoreResult = new HighScoreResult();
236   - try {
237   - boolean next=true;
238   - //复诊
239   - if (null != model && StringUtils.isNotEmpty(model.getRiskFactor()) && !"{}".equals(model.getRiskFactor())) {
240   - List list1 = JsonUtil.toList(model.getRiskFactor(), List.class);
241   - highScoreResult = queryRisk(list1, needLevel);
242   - next=false;
243   - }
244   - if (null != model && !"{}".equals(model.getOtherRisk())) {
245   - Map map = JsonUtil.str2Obj(model.getOtherRisk(), Map.class);
246   -
247   - //风险因素
248   - Map map1 = new HashMap();
249   - map1.put("id", "");
250   - map1.put("name", map.get("fxysu"));
251   - highScoreResult.getHighRisk().add(map1);
252   - //风险评分
253   - Object idObj = map.get("fxpf");
254   - if (null != idObj) {
255   - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj.toString());
256   - highScoreResult.setScore(highScoreResult.getScore() + NumberUtils.toInt(basicConfig.getName(), 0));
  232 + boolean next=true;
  233 + if (CollectionUtils.isNotEmpty(list)) {
  234 + for(AntenatalExaminationModel model:list){
  235 + if(!next){
  236 + break;
257 237 }
258   - if(needLevel){
259   - Object idObj1 = map.get("fyyse");
260   - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj1.toString());
261   - Map<String, Object> map2 = new HashMap<>();
262   - map2.put("id", basicConfig.getId());
263   - map2.put("name", basicConfig.getName());
264   - highScoreResult.getLevel().add(map2);
  238 + //复诊
  239 + if (null != model && StringUtils.isNotEmpty(model.getRiskFactor()) && !"{}".equals(model.getRiskFactor())) {
  240 + List list1 = JsonUtil.toList(model.getRiskFactor(), List.class);
  241 + highScoreResult = queryRisk(list1, needLevel);
  242 + next=false;
265 243 }
266   - next=false;
267   - }
268   - if(next){
269   - //初诊
270   - AntExChuQuery antExChuQuery = new AntExChuQuery();
271   - antExChuQuery.setParentId(parentId);
272   - antExChuQuery.setYn(YnEnums.YES.getId());
273   - List<AntExChuModel> list1 = antenatalExaminationService.queryAntExChu(antExChuQuery);
274   - AntExChuModel antExChuModel = null;
275   - if (CollectionUtils.isNotEmpty(list1)) {
276   - antExChuModel = list1.get(0);
277   - }
278   - if (null != antExChuModel && StringUtils.isNotEmpty(antExChuModel.getHighrisk()) && !"{}".equals(antExChuModel.getHighrisk())) {
279   - List list2 = JsonUtil.toList(antExChuModel.getHighrisk(), List.class);
280   - highScoreResult = queryRisk(list2,true);
281   - }
282   - if (null != antExChuModel && !"{}".equals(antExChuModel.getOtherHighRisk())) {
283   - Map map = JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class);
  244 + if (null != model && !"{}".equals(model.getOtherRisk())) {
  245 + Map map = JsonUtil.str2Obj(model.getOtherRisk(), Map.class);
  246 +
284 247 //风险因素
285 248 Map map1 = new HashMap();
286 249 map1.put("id", "");
287 250  
... ... @@ -300,7 +263,55 @@
300 263 map2.put("name", basicConfig.getName());
301 264 highScoreResult.getLevel().add(map2);
302 265 }
  266 + next=false;
303 267 }
  268 + }
  269 + }
  270 +
  271 + try {
  272 +
  273 + if(next){
  274 + //初诊
  275 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  276 + antExChuQuery.setParentId(parentId);
  277 + antExChuQuery.setYn(YnEnums.YES.getId());
  278 + List<AntExChuModel> list1 = antenatalExaminationService.queryAntExChu(antExChuQuery);
  279 + if (CollectionUtils.isNotEmpty(list1)) {
  280 + for(AntExChuModel antExChuModel:list1){
  281 + if(!next){
  282 + break;
  283 + }
  284 + if (null != antExChuModel && StringUtils.isNotEmpty(antExChuModel.getHighrisk()) && !"{}".equals(antExChuModel.getHighrisk())) {
  285 + List list2 = JsonUtil.toList(antExChuModel.getHighrisk(), List.class);
  286 + highScoreResult = queryRisk(list2,true);
  287 + next=false;
  288 + }
  289 + if (null != antExChuModel && !"{}".equals(antExChuModel.getOtherHighRisk())) {
  290 + Map map = JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class);
  291 + //风险因素
  292 + Map map1 = new HashMap();
  293 + map1.put("id", "");
  294 + map1.put("name", map.get("fxysu"));
  295 + highScoreResult.getHighRisk().add(map1);
  296 + //风险评分
  297 + Object idObj = map.get("fxpf");
  298 + if (null != idObj) {
  299 + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj.toString());
  300 + highScoreResult.setScore(highScoreResult.getScore() + NumberUtils.toInt(basicConfig.getName(), 0));
  301 + }
  302 + if(needLevel){
  303 + Object idObj1 = map.get("fyyse");
  304 + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(idObj1.toString());
  305 + Map<String, Object> map2 = new HashMap<>();
  306 + map2.put("id", basicConfig.getId());
  307 + map2.put("name", basicConfig.getName());
  308 + highScoreResult.getLevel().add(map2);
  309 + }
  310 + next=false;
  311 + }
  312 + }
  313 + }
  314 +
304 315 }
305 316  
306 317 } catch (Exception e) {