Commit 6d70c14cd730af61a8844c929414b14395e708a6
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing 3 changed files
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
6d70c14
| ... | ... | @@ -478,8 +478,6 @@ |
| 478 | 478 | w = 0; |
| 479 | 479 | return weekDays[w]; |
| 480 | 480 | } |
| 481 | - | |
| 482 | - | |
| 483 | 481 | public static Date getRangeDate(Date initDate,int num,String type,int delayDay){ |
| 484 | 482 | |
| 485 | 483 | Calendar rightNow = Calendar.getInstance(); |
| ... | ... | @@ -523,7 +521,6 @@ |
| 523 | 521 | return rightNow.getTime(); |
| 524 | 522 | } |
| 525 | 523 | |
| 526 | - | |
| 527 | 524 | public static void main(String[] arg) { |
| 528 | 525 | /* Date today = new Date(1448336360000L); |
| 529 | 526 | |
| 530 | 527 | |
| ... | ... | @@ -533,17 +530,14 @@ |
| 533 | 530 | System.out.println(new DateTime().minusDays(77));*/ |
| 534 | 531 | // System.out.println(getDaySeconds()); |
| 535 | 532 | |
| 536 | -// int s = getBabyAgeMonth(parseYMD("2016-05-26"), new Date()); | |
| 537 | -// SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd "); | |
| 538 | -//// System.out.println(getBabyAgeMonth(parseYMD("2016-05-23"), new Date())); | |
| 539 | -// System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(new Date(),-108))); | |
| 540 | -// System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(new Date(), -146))); | |
| 533 | + int s = getBabyAgeMonth(parseYMD("2016-05-26"), new Date()); | |
| 534 | + SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd "); | |
| 535 | +// System.out.println(getBabyAgeMonth(parseYMD("2016-05-23"), new Date())); | |
| 536 | + System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(new Date(),-108))); | |
| 537 | + System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.addDay(new Date(), -146))); | |
| 541 | 538 | // System.out.print(1457688652-23341); |
| 542 | 539 | //1457711993 |
| 543 | 540 | // 1426089600 |
| 544 | - | |
| 545 | - getNewDate(-1,"周",0); | |
| 546 | - getNewDate(-0,"周",0); | |
| 547 | 541 | } |
| 548 | 542 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
6d70c14
| ... | ... | @@ -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 @
6d70c14
| ... | ... | @@ -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 | } |