Commit 7bc364565fab4e1729b6588ea9e6e127d98a72d6
1 parent
958757105d
Exists in
master
and in
6 other branches
威海产后观察
Showing 1 changed file with 77 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostpartumRecordsFacade.java
View file @
7bc3645
| ... | ... | @@ -3,17 +3,22 @@ |
| 3 | 3 | import com.lyms.platform.biz.service.*; |
| 4 | 4 | import com.lyms.platform.common.base.PageInfo; |
| 5 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | +import com.lyms.platform.common.enums.FmTypeEnums; | |
| 6 | 7 | import com.lyms.platform.common.enums.OptActionEnums; |
| 8 | +import com.lyms.platform.common.enums.RenShenJieJuEnums; | |
| 7 | 9 | import com.lyms.platform.common.enums.YnEnums; |
| 8 | 10 | import com.lyms.platform.common.result.BaseListResponse; |
| 9 | 11 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 10 | 12 | import com.lyms.platform.common.result.BaseResponse; |
| 11 | 13 | import com.lyms.platform.common.utils.DateUtil; |
| 12 | 14 | import com.lyms.platform.common.utils.ExceptionUtils; |
| 15 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 13 | 16 | import com.lyms.platform.operate.web.request.PostpartumRecordsAddRequest; |
| 14 | 17 | import com.lyms.platform.operate.web.request.PostpartumRecordsQueryRequest; |
| 15 | 18 | import com.lyms.platform.operate.web.result.HighScoreResult; |
| 16 | 19 | import com.lyms.platform.operate.web.result.PostpartumRecordsResult; |
| 20 | +import com.lyms.platform.operate.web.utils.UnitConstants; | |
| 21 | +import com.lyms.platform.operate.web.utils.UnitUtils; | |
| 17 | 22 | import com.lyms.platform.operate.web.worker.PostpartumRecordsWorker; |
| 18 | 23 | import com.lyms.platform.permission.model.Organization; |
| 19 | 24 | import com.lyms.platform.permission.model.Users; |
| ... | ... | @@ -22,6 +27,7 @@ |
| 22 | 27 | import com.lyms.platform.pojo.*; |
| 23 | 28 | import com.lyms.platform.query.*; |
| 24 | 29 | import org.apache.commons.collections.CollectionUtils; |
| 30 | +import org.apache.commons.collections.MapUtils; | |
| 25 | 31 | import org.apache.commons.lang.StringUtils; |
| 26 | 32 | import org.springframework.beans.factory.annotation.Autowired; |
| 27 | 33 | import org.springframework.beans.factory.annotation.Qualifier; |
| ... | ... | @@ -31,6 +37,7 @@ |
| 31 | 37 | import java.util.ArrayList; |
| 32 | 38 | import java.util.Date; |
| 33 | 39 | import java.util.List; |
| 40 | +import java.util.Map; | |
| 34 | 41 | import java.util.concurrent.Callable; |
| 35 | 42 | import java.util.concurrent.Future; |
| 36 | 43 | |
| ... | ... | @@ -105,6 +112,7 @@ |
| 105 | 112 | List<Patients> list = patientsService.queryPatient(patientsQuery); |
| 106 | 113 | if(CollectionUtils.isNotEmpty(list)){ |
| 107 | 114 | parentId = list.get(0).getId(); |
| 115 | + postpartumRecordsResult.setParentId(parentId); | |
| 108 | 116 | Patients patients = list.get(0); |
| 109 | 117 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); |
| 110 | 118 | matDeliverQuery.setParentId(parentId); |
| ... | ... | @@ -113,6 +121,7 @@ |
| 113 | 121 | List<MaternalDeliverModel> mdList = matDeliverService.query(matDeliverQuery); |
| 114 | 122 | if(CollectionUtils.isNotEmpty(mdList)){ |
| 115 | 123 | MaternalDeliverModel maternalDeliverModel = mdList.get(0); |
| 124 | + postpartumRecordsResult.setMaternalDeliverId(maternalDeliverModel.getId()); | |
| 116 | 125 | prQuery.setParentId(parentId); |
| 117 | 126 | prQuery.setIsDelete("1"); |
| 118 | 127 | prQuery.setId(null); |
| 119 | 128 | |
| ... | ... | @@ -126,12 +135,80 @@ |
| 126 | 135 | postpartumRecords = prList.get(0); |
| 127 | 136 | //查询是否存在记录详情 |
| 128 | 137 | String postId = postpartumRecords.getId(); |
| 138 | + postpartumRecordsResult.setId(postId); | |
| 129 | 139 | RecordsQuery recordsQuery = new RecordsQuery(); |
| 130 | 140 | recordsQuery.setPostId(postId); |
| 131 | 141 | recordsQuery.setIsDelete("1");//查询有效的数据 |
| 132 | 142 | List<Records> recordList = recordsService.getRecordsListQuery(recordsQuery); |
| 133 | 143 | if(CollectionUtils.isNotEmpty(recordList)){ |
| 134 | 144 | postpartumRecordsResult.setRecords(recordList); |
| 145 | + }else{ | |
| 146 | + String deliveryMode = ""; | |
| 147 | + if (StringUtils.isNotEmpty(maternalDeliverModel.getDeliveryMode())) { | |
| 148 | + | |
| 149 | + StringBuilder sb = new StringBuilder(); | |
| 150 | + | |
| 151 | + Map m = JsonUtil.str2Obj(maternalDeliverModel.getDeliveryMode(), Map.class); | |
| 152 | + String fmfs = null; | |
| 153 | + if (m != null) { | |
| 154 | + Object b = m.get("fmfs"); | |
| 155 | + if (b != null) { | |
| 156 | + fmfs = b.toString(); | |
| 157 | + if (fmfs != null) { | |
| 158 | + if (fmfs.equals("1")) { | |
| 159 | + String fmName = FmTypeEnums.getFmNameById(fmfs); | |
| 160 | + sb.append(fmName); | |
| 161 | + /*if (null != m.get("scfs") && !"null".equals(m.get("scfs").toString())) { | |
| 162 | + sb.append(","); | |
| 163 | + String scfs = m.get("scfs").toString(); | |
| 164 | + sb.append(FmTypeEnums.getFmScNameById(scfs)); | |
| 165 | + }*/ | |
| 166 | + deliveryMode = sb.toString(); | |
| 167 | + } else if (fmfs.equals("2")) { | |
| 168 | + String fmName = FmTypeEnums.getFmNameById(fmfs); | |
| 169 | + deliveryMode = fmName; | |
| 170 | + } | |
| 171 | + } | |
| 172 | + } | |
| 173 | + } | |
| 174 | + } | |
| 175 | + List<MaternalDeliverModel.Baby> babyList = maternalDeliverModel.getBaby(); | |
| 176 | + if(CollectionUtils.isNotEmpty(babyList)){ | |
| 177 | + String mr = ""; | |
| 178 | + for(MaternalDeliverModel.Baby baby : babyList){ | |
| 179 | + String sex = ""; | |
| 180 | + String pregnancyOut = ""; | |
| 181 | + if("1".equals(baby.getBabyGender())){ | |
| 182 | + sex = "男"; | |
| 183 | + } | |
| 184 | + if(baby.getPregnancyOut() != null){ | |
| 185 | + if("活产".equals(RenShenJieJuEnums.getTitle(baby.getPregnancyOut()))){ | |
| 186 | + pregnancyOut = "活婴"; | |
| 187 | + } | |
| 188 | + } | |
| 189 | + String apgarScorePf1 = ""; | |
| 190 | + String apgarScorePf5 = ""; | |
| 191 | + String apgarScorePf10 = ""; | |
| 192 | + Map<String, String> m = JsonUtil.getMap(baby.getApgarScore()); | |
| 193 | + if (MapUtils.isNotEmpty(m)) { | |
| 194 | + apgarScorePf1 += m.get("pf1") == null ? "" : m.get("pf1"); | |
| 195 | + apgarScorePf5 += m.get("pf5") == null ? "" : m.get("pf5"); | |
| 196 | + apgarScorePf10 += m.get("pf10") == null ? "" : m.get("pf10"); | |
| 197 | + } | |
| 198 | + String apgarScore = ""; | |
| 199 | + | |
| 200 | + if (StringUtils.isNotEmpty(apgarScorePf1) || StringUtils.isNotEmpty(apgarScorePf5) || StringUtils.isNotEmpty(apgarScorePf10)) { | |
| 201 | + apgarScore = apgarScorePf1 + UnitConstants.FEN + " - " + apgarScorePf5 + UnitConstants.FEN + " - " + apgarScorePf10 + UnitConstants.FEN; | |
| 202 | + } | |
| 203 | + String babyWeight = UnitUtils.unitSplice(baby.getBabyWeight(), UnitConstants.G); | |
| 204 | + String babyHeight = UnitUtils.unitSplice(baby.getBabyHeight(), UnitConstants.CM); | |
| 205 | + mr+=" 于 "+baby.getDueTime()+" "+deliveryMode+"一"+sex+" "+pregnancyOut+",评"+apgarScore+",体重"+babyWeight+",身长"+babyHeight; | |
| 206 | + } | |
| 207 | + Records records = new Records(); | |
| 208 | + records.setFz(mr); | |
| 209 | + recordList.add(records); | |
| 210 | + postpartumRecordsResult.setRecords(recordList); | |
| 211 | + } | |
| 135 | 212 | } |
| 136 | 213 | postpartumRecordsResult.convertToResult(postpartumRecords); |
| 137 | 214 | } |