Commit 63031ecd93ce15a22dd64a57333d750280cdb4c1
1 parent
6959eb34a1
Exists in
master
and in
1 other branch
增加设置parentid
Showing 2 changed files with 51 additions and 29 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PostReviewFacade.java
View file @
63031ec
| ... | ... | @@ -28,6 +28,7 @@ |
| 28 | 28 | import org.springframework.beans.factory.annotation.Autowired; |
| 29 | 29 | import org.springframework.stereotype.Component; |
| 30 | 30 | |
| 31 | +import java.util.ArrayList; | |
| 31 | 32 | import java.util.List; |
| 32 | 33 | |
| 33 | 34 | /** |
| ... | ... | @@ -68,11 +69,7 @@ |
| 68 | 69 | } |
| 69 | 70 | |
| 70 | 71 | public BaseResponse queryPostList(PostReviewQueryRequest postReviewQueryRequest,Integer userId) { |
| 71 | - /*PatientsQuery patientsQuery = new PatientsQuery(); | |
| 72 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
| 73 | - patientsQuery.setCardNo(postReviewQueryRequest.getCardNo()); | |
| 74 | - patientsQuery.setVcCardNo(postReviewQueryRequest.getVcCardNo()); | |
| 75 | - Patients patientsList = patientsService.findOnePatientByCardNo(patientsQuery);*/ | |
| 72 | + | |
| 76 | 73 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 77 | 74 | //取所有医院的建档数据 优先取本院 ,然后取外院 |
| 78 | 75 | Patients patientsList = examinationFacade.findOnePatient(postReviewQueryRequest.getCardNo(), postReviewQueryRequest.getVcCardNo(), null, hospitalId, 3); |
| 79 | 76 | |
| ... | ... | @@ -94,7 +91,20 @@ |
| 94 | 91 | |
| 95 | 92 | } |
| 96 | 93 | HighScoreResult highScoreResult = examinationFacade.findLastRisk(patientsList.getId(),false); |
| 94 | + | |
| 95 | + List<PostReviewListResult.AntData> dataList = new ArrayList<>(); | |
| 96 | + if(CollectionUtils.isNotEmpty(postReviewModels)){ | |
| 97 | + String hospitalName=""; | |
| 98 | + for(PostReviewModel model:postReviewModels){ | |
| 99 | + Organization organization = organizationService.getOrganization(NumberUtils.toInt(model.getHospitalId())); | |
| 100 | + if(null!=organization){ | |
| 101 | + hospitalName=organization.getName(); | |
| 102 | + } | |
| 103 | + dataList.add(new PostReviewListResult.AntData(model,hospitalName)); | |
| 104 | + } | |
| 105 | + } | |
| 97 | 106 | postReviewListResult.convertToResult(postReviewModels, patientsList, dueDate); |
| 107 | + postReviewListResult.setData(dataList); | |
| 98 | 108 | postReviewListResult.setRiskFactor(highScoreResult.getHighRisk()); |
| 99 | 109 | postReviewListResult.setRiskScore(highScoreResult.getScore()+""); |
| 100 | 110 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PostReviewListResult.java
View file @
63031ec
| ... | ... | @@ -2,20 +2,16 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.utils.DateUtil; |
| 4 | 4 | import com.lyms.platform.common.utils.StringUtils; |
| 5 | -import com.lyms.platform.pojo.AntExChuModel; | |
| 6 | -import com.lyms.platform.pojo.AntenatalExaminationModel; | |
| 7 | 5 | import com.lyms.platform.pojo.Patients; |
| 8 | 6 | import com.lyms.platform.pojo.PostReviewModel; |
| 9 | -import org.apache.commons.collections.CollectionUtils; | |
| 10 | 7 | |
| 11 | 8 | import java.util.ArrayList; |
| 12 | 9 | import java.util.Date; |
| 13 | 10 | import java.util.List; |
| 14 | 11 | |
| 15 | 12 | /** |
| 16 | - * | |
| 17 | 13 | * 产后复查记录 |
| 18 | - * | |
| 14 | + * <p> | |
| 19 | 15 | * Created by Administrator on 2016/6/28 0028. |
| 20 | 16 | */ |
| 21 | 17 | public class PostReviewListResult { |
| 22 | 18 | |
| 23 | 19 | |
| 24 | 20 | |
| 25 | 21 | |
| 26 | 22 | |
| 27 | 23 | |
| 28 | 24 | |
| 29 | 25 | |
| 30 | 26 | |
| 31 | 27 | |
| ... | ... | @@ -148,48 +144,64 @@ |
| 148 | 144 | this.yChanQi = yChanQi; |
| 149 | 145 | } |
| 150 | 146 | |
| 151 | - public PostReviewListResult convertToResult(List<PostReviewModel> destModel,Patients patients,String dueDate) { | |
| 147 | + public PostReviewListResult convertToResult(List<PostReviewModel> destModel, Patients patients, String dueDate) { | |
| 152 | 148 | setDueDate(dueDate); |
| 153 | 149 | setId(patients.getId()); |
| 154 | 150 | try { |
| 155 | - if(null!=patients.getBirth()){ | |
| 151 | + if (null != patients.getBirth()) { | |
| 156 | 152 | setAge(DateUtil.getAge(patients.getBirth())); |
| 157 | 153 | } |
| 158 | - }catch (Exception e){ | |
| 154 | + } catch (Exception e) { | |
| 159 | 155 | } |
| 160 | 156 | setName(patients.getUsername()); |
| 161 | 157 | setPhone(patients.getPhone()); |
| 162 | 158 | setRemarks(patients.getMremark()); |
| 163 | 159 | setRiskScore("60"); |
| 164 | - if(null!=patients.getDueDate()){ | |
| 160 | + if (null != patients.getDueDate()) { | |
| 165 | 161 | setyChanQi(DateUtil.getyyyy_MM_dd(patients.getDueDate())); |
| 166 | 162 | } |
| 167 | - int days= DateUtil.daysBetween(patients.getLastMenses(),new Date()); | |
| 168 | - this.dueWeek= StringUtils.dueWeek(days); | |
| 169 | - if(null!=patients.getLastMenses()){ | |
| 163 | + int days = DateUtil.daysBetween(patients.getLastMenses(), new Date()); | |
| 164 | + this.dueWeek = StringUtils.dueWeek(days); | |
| 165 | + if (null != patients.getLastMenses()) { | |
| 170 | 166 | setLastMenses(DateUtil.getyyyy_MM_dd(patients.getLastMenses())); |
| 171 | 167 | } |
| 172 | - List<AntData> dataList = new ArrayList<>(); | |
| 173 | - if(CollectionUtils.isNotEmpty(destModel)){ | |
| 174 | - for(PostReviewModel model:destModel){ | |
| 175 | - dataList.add(new AntData(model)); | |
| 176 | - } | |
| 177 | - } | |
| 178 | - setData(dataList); | |
| 168 | + | |
| 169 | + | |
| 179 | 170 | setcTime(DateUtil.getyyyy_MM_dd(new Date())); |
| 180 | 171 | return this; |
| 181 | 172 | } |
| 182 | - private class AntData{ | |
| 173 | + | |
| 174 | + public static class AntData { | |
| 183 | 175 | private String dueWeek; |
| 184 | 176 | private String id; |
| 185 | 177 | private String checkTime; |
| 178 | + private String hospitalName; | |
| 179 | + private String hospitalId; | |
| 186 | 180 | |
| 181 | + public AntData(PostReviewModel model, String hospitalName) { | |
| 182 | + this.id = model.getId(); | |
| 183 | + this.dueWeek = model.getDay(); | |
| 184 | + this.checkTime = model.getCheckTime(); | |
| 185 | + this.hospitalId = model.getHospitalId(); | |
| 186 | + this.hospitalName = hospitalName; | |
| 187 | + } | |
| 187 | 188 | |
| 188 | - public AntData(PostReviewModel model){ | |
| 189 | - this.id=model.getId(); | |
| 190 | - this.dueWeek=model.getDay(); | |
| 191 | - this.checkTime=model.getCheckTime(); | |
| 189 | + public String getHospitalId() { | |
| 190 | + return hospitalId; | |
| 192 | 191 | } |
| 192 | + | |
| 193 | + public void setHospitalId(String hospitalId) { | |
| 194 | + this.hospitalId = hospitalId; | |
| 195 | + } | |
| 196 | + | |
| 197 | + public String getHospitalName() { | |
| 198 | + return hospitalName; | |
| 199 | + } | |
| 200 | + | |
| 201 | + public void setHospitalName(String hospitalName) { | |
| 202 | + this.hospitalName = hospitalName; | |
| 203 | + } | |
| 204 | + | |
| 193 | 205 | public String getCheckTime() { |
| 194 | 206 | return checkTime; |
| 195 | 207 | } |