Commit 29846d9e921cd64afe1c04a49710dd3569a04525
1 parent
5457abcab1
Exists in
master
and in
6 other branches
自测bug提交
Showing 5 changed files with 102 additions and 27 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/TemporaryBloodSugar.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TemporaryBloodSugarController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryBloodServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryBloodSugarServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryWeightServiceImpl.java
platform-dal/src/main/java/com/lyms/platform/pojo/TemporaryBloodSugar.java
View file @
29846d9
| ... | ... | @@ -59,6 +59,16 @@ |
| 59 | 59 | // 前囟 单胎/双胎/多胎 |
| 60 | 60 | private String bregmatic; |
| 61 | 61 | |
| 62 | + private String riskLevelId; | |
| 63 | + | |
| 64 | + public String getRiskLevelId() { | |
| 65 | + return riskLevelId; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public void setRiskLevelId(String riskLevelId) { | |
| 69 | + this.riskLevelId = riskLevelId; | |
| 70 | + } | |
| 71 | + | |
| 62 | 72 | public String getBregmatic() { |
| 63 | 73 | return bregmatic; |
| 64 | 74 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TemporaryBloodSugarController.java
View file @
29846d9
| ... | ... | @@ -38,7 +38,7 @@ |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
| 41 | - @RequestMapping(value = "/querOne", method = RequestMethod.GET) | |
| 41 | + @RequestMapping(value = "/queryOne", method = RequestMethod.GET) | |
| 42 | 42 | @TokenRequired |
| 43 | 43 | @ResponseBody |
| 44 | 44 | public BaseResponse queryOne(@RequestParam(value = "id") String id) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryBloodServiceImpl.java
View file @
29846d9
| ... | ... | @@ -156,7 +156,7 @@ |
| 156 | 156 | requestMap.put("id", bloodModel.getId()); |
| 157 | 157 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(requestMap); |
| 158 | 158 | } |
| 159 | - return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(bloodModel); | |
| 159 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DEPT_NOT_EXISTS).setErrormsg("请选择一条记录"); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | @Override |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryBloodSugarServiceImpl.java
View file @
29846d9
| ... | ... | @@ -6,8 +6,10 @@ |
| 6 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 7 | 7 | import com.lyms.platform.common.enums.BloodSugarEnums; |
| 8 | 8 | import com.lyms.platform.common.enums.BloodSugarEnums2; |
| 9 | +import com.lyms.platform.common.enums.HisptialRiskTypeEnum; | |
| 9 | 10 | import com.lyms.platform.common.result.*; |
| 10 | 11 | import com.lyms.platform.common.utils.DateUtil; |
| 12 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 11 | 13 | import com.lyms.platform.common.utils.StringUtils; |
| 12 | 14 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
| 13 | 15 | import com.lyms.platform.operate.web.service.ITemporaryBloodSugarService; |
| ... | ... | @@ -67,6 +69,16 @@ |
| 67 | 69 | bloodSugar.setModified(new Date()); |
| 68 | 70 | bloodSugar.setCreated(new Date()); |
| 69 | 71 | bloodSugar.setYn(1); |
| 72 | + List<String> riskLevelIdList = new ArrayList<>(); | |
| 73 | + if (CollectionUtils.isNotEmpty(bloodSugar.getRiskFactorId())) { | |
| 74 | + List<String> riskFactor = bloodSugar.getRiskFactorId(); | |
| 75 | + for (String risk : riskFactor) { | |
| 76 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(risk); | |
| 77 | + riskLevelIdList.add(basicConfig.getParentId()); | |
| 78 | + } | |
| 79 | + } | |
| 80 | + bloodSugar.setRiskLevelId(JsonUtil.array2JsonString(riskLevelIdList)); | |
| 81 | + | |
| 70 | 82 | TemporaryBloodSugar bloodSugar1 = temporaryBloodSugarDao.addTemporaryBloodSugar(bloodSugar); |
| 71 | 83 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("添加成功").setData(bloodSugar1.getId()); |
| 72 | 84 | } |
| ... | ... | @@ -74,6 +86,15 @@ |
| 74 | 86 | bloodSugar.setModified(new Date()); |
| 75 | 87 | bloodSugar.setCreated(new Date()); |
| 76 | 88 | bloodSugar.setYn(1); |
| 89 | + List<String> riskLevelIdList = new ArrayList<>(); | |
| 90 | + if (CollectionUtils.isNotEmpty(bloodSugar.getRiskFactorId())) { | |
| 91 | + List<String> riskFactor = bloodSugar.getRiskFactorId(); | |
| 92 | + for (String risk : riskFactor) { | |
| 93 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(risk); | |
| 94 | + riskLevelIdList.add(basicConfig.getParentId()); | |
| 95 | + } | |
| 96 | + } | |
| 97 | + bloodSugar.setRiskLevelId(JsonUtil.array2JsonString(riskLevelIdList)); | |
| 77 | 98 | TemporaryBloodSugar bloodSugar1 = temporaryBloodSugarDao.addTemporaryBloodSugar(bloodSugar); |
| 78 | 99 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("添加成功").setData(bloodSugar1.getId()); |
| 79 | 100 | } |
| ... | ... | @@ -88,7 +109,52 @@ |
| 88 | 109 | @Override |
| 89 | 110 | public BaseResponse queryOne(String id) { |
| 90 | 111 | TemporaryBloodSugar bloodModel = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(id)), TemporaryBloodSugar.class); |
| 91 | - return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(bloodModel); | |
| 112 | + if (bloodModel != null) { | |
| 113 | + Map<String, Object> requestMap = new HashMap<>(); | |
| 114 | + List<String> rists = bloodModel.getRiskFactorId(); | |
| 115 | + List<Map> listMap = new ArrayList<>(); | |
| 116 | + Integer riskScore = 0; | |
| 117 | + if (com.lyms.platform.operate.web.utils.CollectionUtils.isNotEmpty(rists)) { | |
| 118 | + for (String rist : rists) { | |
| 119 | + Map<String, Object> map = new HashMap(); | |
| 120 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(rist); | |
| 121 | + if (basicConfig != null) { | |
| 122 | + riskScore += Integer.valueOf(basicConfig.getCode()); | |
| 123 | + if (StringUtils.isNotEmpty(basicConfig.getParentId())) { | |
| 124 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.YBFX.getId())) { | |
| 125 | + map.put("color", HisptialRiskTypeEnum.YBFX.getColor()); | |
| 126 | + } | |
| 127 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.JGFX.getId())) { | |
| 128 | + map.put("color", HisptialRiskTypeEnum.JGFX.getColor()); | |
| 129 | + } | |
| 130 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.GFX.getId())) { | |
| 131 | + map.put("color", HisptialRiskTypeEnum.GFX.getColor()); | |
| 132 | + } | |
| 133 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.CRB.getId())) { | |
| 134 | + map.put("color", HisptialRiskTypeEnum.CRB.getColor()); | |
| 135 | + } | |
| 136 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.JK.getId())) { | |
| 137 | + map.put("color", HisptialRiskTypeEnum.JK.getColor()); | |
| 138 | + } | |
| 139 | + map.put("name", basicConfig.getName()); | |
| 140 | + map.put("id", basicConfig.getId()); | |
| 141 | + listMap.add(map); | |
| 142 | + } | |
| 143 | + } | |
| 144 | + | |
| 145 | + } | |
| 146 | + requestMap.put("riskScore", riskScore); | |
| 147 | + requestMap.put("riskFactor", listMap); | |
| 148 | + requestMap.put("userName", bloodModel.getUserName()); | |
| 149 | + requestMap.put("age", bloodModel.getAge()); | |
| 150 | + requestMap.put("weeks", DateUtil.getWeekDesc(bloodModel.getLastMenses(), new Date())); | |
| 151 | + requestMap.put("phone", bloodModel.getPhone()); | |
| 152 | + requestMap.put("id", bloodModel.getId()); | |
| 153 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(requestMap); | |
| 154 | + } | |
| 155 | + } | |
| 156 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DEPT_NOT_EXISTS).setErrormsg("请选择一条记录"); | |
| 157 | + | |
| 92 | 158 | } |
| 93 | 159 | |
| 94 | 160 | @Override |
| ... | ... | @@ -132,11 +198,7 @@ |
| 132 | 198 | temp.put("time", DateUtil.getyyyy_MM_dd(bloodSugar.getModified())); |
| 133 | 199 | temp.put("age", bloodSugar.getAge()); |
| 134 | 200 | temp.put("week", DateUtil.getWeekDesc(bloodSugar.getLastMenses(), new Date())); |
| 135 | - | |
| 136 | - | |
| 137 | - //temp.put("riskLevel", commonService.findRiskLevel(p.getRiskLevelId())); //高危等级(颜色) | |
| 138 | - | |
| 139 | - | |
| 201 | + temp.put("riskLevel", commonService.findRiskLevel(bloodSugar.getRiskLevelId())); //高危等级(颜色) | |
| 140 | 202 | String rFactor = commonService.resloveFactor(bloodSugar.getRiskFactorId()); |
| 141 | 203 | if (bloodSugar.getHighriskDesc() != null && !"null".equals(bloodSugar.getHighriskDesc())) { |
| 142 | 204 | if (StringUtils.isNotEmpty(rFactor)) { |
| ... | ... | @@ -153,6 +215,7 @@ |
| 153 | 215 | temp.put("status", getBloodSugarStatus(bloodSugar.getBloodSugarType(), bloodSugar.getBloodSugar())); |
| 154 | 216 | //temp.put("vcCardNo", p.getVcCardNo()); |
| 155 | 217 | // temp.put("pcerteTypeId", p.getPcerteTypeId()); |
| 218 | + temp.put("bregmatic", bloodSugar.getBregmatic()); | |
| 156 | 219 | temp.put("cardNo", bloodSugar.getCardID()); |
| 157 | 220 | } |
| 158 | 221 | restList.add(temp); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryWeightServiceImpl.java
View file @
29846d9
| ... | ... | @@ -139,26 +139,28 @@ |
| 139 | 139 | Map<String, Object> map = new HashMap(); |
| 140 | 140 | BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(rist); |
| 141 | 141 | riskScore += Integer.valueOf(basicConfig.getCode()); |
| 142 | - map.put("code", basicConfig.getCode()); | |
| 143 | - BasicConfig basicConfig1 = basicConfigService.getOneBasicConfigById(basicConfig.getParentId()); | |
| 144 | - if (basicConfig1.getId().equals(HisptialRiskTypeEnum.YBFX.getId())) { | |
| 145 | - map.put("color", HisptialRiskTypeEnum.YBFX.getColor()); | |
| 142 | + | |
| 143 | + if (StringUtils.isNotEmpty(basicConfig.getParentId())) { | |
| 144 | + map.put("code", basicConfig.getCode()); | |
| 145 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.YBFX.getId())) { | |
| 146 | + map.put("color", HisptialRiskTypeEnum.YBFX.getColor()); | |
| 147 | + } | |
| 148 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.JGFX.getId())) { | |
| 149 | + map.put("color", HisptialRiskTypeEnum.JGFX.getColor()); | |
| 150 | + } | |
| 151 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.GFX.getId())) { | |
| 152 | + map.put("color", HisptialRiskTypeEnum.GFX.getColor()); | |
| 153 | + } | |
| 154 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.CRB.getId())) { | |
| 155 | + map.put("color", HisptialRiskTypeEnum.CRB.getColor()); | |
| 156 | + } | |
| 157 | + if (basicConfig.getParentId().equals(HisptialRiskTypeEnum.JK.getId())) { | |
| 158 | + map.put("color", HisptialRiskTypeEnum.JK.getColor()); | |
| 159 | + } | |
| 160 | + map.put("name", basicConfig.getName()); | |
| 161 | + map.put("id", basicConfig.getId()); | |
| 162 | + listMap.add(map); | |
| 146 | 163 | } |
| 147 | - if (basicConfig1.getId().equals(HisptialRiskTypeEnum.JGFX.getId())) { | |
| 148 | - map.put("color", HisptialRiskTypeEnum.JGFX.getColor()); | |
| 149 | - } | |
| 150 | - if (basicConfig1.getId().equals(HisptialRiskTypeEnum.GFX.getId())) { | |
| 151 | - map.put("color", HisptialRiskTypeEnum.GFX.getColor()); | |
| 152 | - } | |
| 153 | - if (basicConfig1.getId().equals(HisptialRiskTypeEnum.CRB.getId())) { | |
| 154 | - map.put("color", HisptialRiskTypeEnum.CRB.getColor()); | |
| 155 | - } | |
| 156 | - if (basicConfig1.getId().equals(HisptialRiskTypeEnum.JK.getId())) { | |
| 157 | - map.put("color", HisptialRiskTypeEnum.JK.getColor()); | |
| 158 | - } | |
| 159 | - map.put("name", basicConfig.getName()); | |
| 160 | - map.put("id", basicConfig.getId()); | |
| 161 | - listMap.add(map); | |
| 162 | 164 | } |
| 163 | 165 | } |
| 164 | 166 | requestMap.put("riskScore", riskScore); |