Commit 0174cd239f1af01bf77fcbd53151285242c044b0
1 parent
715623d561
Exists in
master
and in
8 other branches
增加是否通知
Showing 3 changed files with 55 additions and 7 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
0174cd2
| ... | ... | @@ -33,7 +33,19 @@ |
| 33 | 33 | } |
| 34 | 34 | return days; |
| 35 | 35 | } |
| 36 | - | |
| 36 | + public static void orderDate(List<Date> dates){ | |
| 37 | + Collections.sort(dates, new Comparator<Date>() { | |
| 38 | + @Override | |
| 39 | + public int compare(Date o1, Date o2) { | |
| 40 | + if(o1.before(o2)){ | |
| 41 | + return -1; | |
| 42 | + }else if(o1.after(o2)){ | |
| 43 | + return 1; | |
| 44 | + } | |
| 45 | + return 0; | |
| 46 | + } | |
| 47 | + }); | |
| 48 | + } | |
| 37 | 49 | public static Integer minute2Index(Date date) { |
| 38 | 50 | DateTime dt = new DateTime(date.getTime()); |
| 39 | 51 | return dt.getMinuteOfDay() / 10; |
| 40 | 52 | |
| ... | ... | @@ -492,11 +504,21 @@ |
| 492 | 504 | int s = getBabyAgeMonth(parseYMD("2016-05-26"), new Date()); |
| 493 | 505 | SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd "); |
| 494 | 506 | // System.out.println(getBabyAgeMonth(parseYMD("2016-05-23"), new Date())); |
| 495 | - System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(new Date(),-108))); | |
| 496 | - System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(new Date(), -146))); | |
| 507 | + /* System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(new Date(),-108))); | |
| 508 | + System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(new Date(), -146))); */ | |
| 497 | 509 | // System.out.print(1457688652-23341); |
| 498 | 510 | //1457711993 |
| 499 | 511 | // 1426089600 |
| 512 | + List<Date> data =new ArrayList<>(); | |
| 513 | + data.add(parseYMD("2016-01-26")); | |
| 514 | + data.add(parseYMD("2016-04-26")); | |
| 515 | + data.add(parseYMD("2016-02-26")); | |
| 516 | + data.add(parseYMD("2016-05-26")); | |
| 517 | + data.add(parseYMD("2016-03-26")); | |
| 518 | + orderDate(data); | |
| 519 | + for(Date d:data){ | |
| 520 | + System.out.print(simpleDateFormat.format(d)); | |
| 521 | + } | |
| 500 | 522 | } |
| 501 | 523 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
0174cd2
| ... | ... | @@ -10,10 +10,7 @@ |
| 10 | 10 | import com.lyms.platform.common.utils.JsonUtil; |
| 11 | 11 | import com.lyms.platform.common.utils.SystemConfig; |
| 12 | 12 | import com.lyms.platform.operate.web.request.*; |
| 13 | -import com.lyms.platform.operate.web.result.AntData; | |
| 14 | -import com.lyms.platform.operate.web.result.AntenatalExaminationResult; | |
| 15 | -import com.lyms.platform.operate.web.result.AntexChuResult; | |
| 16 | -import com.lyms.platform.operate.web.result.AntexListResult; | |
| 13 | +import com.lyms.platform.operate.web.result.*; | |
| 17 | 14 | import com.lyms.platform.permission.model.Organization; |
| 18 | 15 | import com.lyms.platform.permission.service.OrganizationService; |
| 19 | 16 | import com.lyms.platform.pojo.*; |
| ... | ... | @@ -51,6 +48,8 @@ |
| 51 | 48 | private PostReviewService postReviewService; |
| 52 | 49 | @Autowired |
| 53 | 50 | private AutoMatchFacade autoMatchFacade; |
| 51 | + @Autowired | |
| 52 | + private StopPregnancyService stopPregnancyService; | |
| 54 | 53 | |
| 55 | 54 | /** |
| 56 | 55 | * 增加一条产前检查 |
| ... | ... | @@ -172,6 +171,7 @@ |
| 172 | 171 | if (CollectionUtils.isNotEmpty(list)) { |
| 173 | 172 | antexListResult.convertToResult(null, list.get(0), null); |
| 174 | 173 | for (Patients patients : list) { |
| 174 | + List<StopPregModel> stopPregs =null; | |
| 175 | 175 | List<AntData> data = new ArrayList<>(); |
| 176 | 176 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); |
| 177 | 177 | matDeliverQuery.setYn(YnEnums.YES.getId()); |
| ... | ... | @@ -188,6 +188,15 @@ |
| 188 | 188 | if (CollectionUtils.isNotEmpty(modelList)) { |
| 189 | 189 | MaternalDeliverModel model = modelList.get(0); |
| 190 | 190 | dueDate = model.getDueDate(); |
| 191 | + }else { | |
| 192 | + //终止妊娠 | |
| 193 | + StopPregQuery query = new StopPregQuery(); | |
| 194 | + query.setYn(YnEnums.YES.getId()); | |
| 195 | + query.setPid(patients.getPid()); | |
| 196 | + stopPregs = stopPregnancyService.queryStopPreg(query); | |
| 197 | + if(CollectionUtils.isNotEmpty(stopPregs)){ | |
| 198 | + dueDate=DateUtil.getyyyy_MM_dd(stopPregs.get(0).getStopDate()); | |
| 199 | + } | |
| 191 | 200 | } |
| 192 | 201 | PostReviewQuery postReviewQuery = new PostReviewQuery();; |
| 193 | 202 | if (StringUtils.isNotEmpty(dueDate)) { |
| ... | ... | @@ -238,6 +247,10 @@ |
| 238 | 247 | if (CollectionUtils.isNotEmpty(modelList)) { |
| 239 | 248 | organization = organizationService.getOrganization(Integer.valueOf(modelList.get(0).getHospitalId())); |
| 240 | 249 | data.add(new AntData(modelList.get(0), patients.getLastMenses(), null != organization ? organization.getName() : "")); |
| 250 | + }else if(CollectionUtils.isNotEmpty(stopPregs)){ | |
| 251 | + //终止妊娠记录 | |
| 252 | + organization = organizationService.getOrganization(Integer.valueOf(modelList.get(0).getHospitalId())); | |
| 253 | + data.add(new AntData(stopPregs.get(0), patients.getLastMenses(), null != organization ? organization.getName() : "")); | |
| 241 | 254 | } |
| 242 | 255 | //产后复查记录 |
| 243 | 256 | List<PostReviewModel> reviewModels = postReviewService.findWithList(postReviewQuery); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntData.java
View file @
0174cd2
| ... | ... | @@ -112,6 +112,19 @@ |
| 112 | 112 | this.hospitalId=postReviewModel.getHospitalId(); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | + public AntData(StopPregModel postReviewModel,Date lastMenses,String hospitalName) { | |
| 116 | + this.id=postReviewModel.getId(); | |
| 117 | + int days= DateUtil.daysBetween(lastMenses,postReviewModel.getStopDate()); | |
| 118 | + String week= (days/7)+""; | |
| 119 | + int day = (days%7); | |
| 120 | + this.dueWeek="孕"+week+"周" +(day>0?"+"+day+"天":""); | |
| 121 | + this.checkTime=DateUtil.getyyyy_MM_dd(postReviewModel.getCreated()); | |
| 122 | + this.title="终止妊娠"; | |
| 123 | + this.type="6"; | |
| 124 | + this.hospitalName=hospitalName; | |
| 125 | + this.hospitalId="医院id"; | |
| 126 | + } | |
| 127 | + | |
| 115 | 128 | public String getCheckTime() { |
| 116 | 129 | return checkTime; |
| 117 | 130 | } |