From da6e750602414fe81708eb39b6f95a1e0eaaa795 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Thu, 29 Jul 2021 16:10:53 +0800 Subject: [PATCH] update --- .../service/impl/BabyEvaluationCriterionServiceImpl.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java index 0df0d9c..6725a73 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEvaluationCriterionServiceImpl.java @@ -744,6 +744,7 @@ public class BabyEvaluationCriterionServiceImpl implements BabyEvaluationCriteri return new BaseResponse().setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setErrormsg("儿童建档数据缺失"); } Integer checkMonth = DateUtil.getBabyAgeMonth(babyModel.getBirth(), new Date()); + double monthDay = checkMonth+DateUtil.getMonthDays(babyModel.getBirth()); paramModel.setName(babyModel.getName()); paramModel.setGender(babyModel.getSex()); paramModel.setBirth(babyModel.getBirth()); @@ -754,7 +755,7 @@ public class BabyEvaluationCriterionServiceImpl implements BabyEvaluationCriteri update(userId, configId, id, paramModel); } else { // 新增 - paramModel = getLevelByConfigId(paramModel, checkMonth); + paramModel = getLevelByConfigId(paramModel, checkMonth, monthDay); paramModel.setHospitalId(hospitalId); paramModel.setCreateTime(new Date()); paramModel.setCreateUser(userId.toString()); @@ -816,7 +817,7 @@ public class BabyEvaluationCriterionServiceImpl implements BabyEvaluationCriteri * @param paramModel * @return */ - private BabyNeuroPsychologicalModel getLevelByConfigId(BabyNeuroPsychologicalModel paramModel, Integer checkMonth) { + private BabyNeuroPsychologicalModel getLevelByConfigId(BabyNeuroPsychologicalModel paramModel, Integer checkMonth,double monthDay) { List configIds = paramModel.getConfigId(); Double val = 0d; for (String configId : configIds) { @@ -824,6 +825,8 @@ public class BabyEvaluationCriterionServiceImpl implements BabyEvaluationCriteri val += evaluationCriterionModel.getProjectVal(); } + paramModel.setDevelopmentQuotient((int)(val/5/monthDay*100)); + Integer month = DateUtil.getBabyMonthAge1(paramModel.getBirth(), new Date()); int [] months = null; months = getInts(months, month); @@ -858,7 +861,7 @@ public class BabyEvaluationCriterionServiceImpl implements BabyEvaluationCriteri aptitudeName = criterionModel.getAptitudeName(); levelName = criterionModel.getLevelName(); } - paramModel.setDevelopmentQuotient(developmentQuotient.intValue()); + paramModel.setAptitudeName(aptitudeName); paramModel.setLevelName(levelName); return paramModel; @@ -874,7 +877,9 @@ public class BabyEvaluationCriterionServiceImpl implements BabyEvaluationCriteri private void update(Integer userId, List configId, String id, BabyNeuroPsychologicalModel paramModel) { BabyNeuroPsychologicalModel model = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(id)), BabyNeuroPsychologicalModel.class); Integer checkMonth = model.getCheckMonth(); - paramModel = getLevelByConfigId(paramModel, checkMonth); + BabyModel babyModel = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(model.getBabyId())), BabyModel.class); + double monthDay = checkMonth+DateUtil.getMonthDays(babyModel.getBirth()); + paramModel = getLevelByConfigId(paramModel, checkMonth,monthDay); Query query = Query.query(Criteria.where("_id").is(id)); Update update = new Update(); update.set("configId", configId); -- 1.8.3.1