Commit b0cc54f4ca26154a3700e539539c213fde8f4159
1 parent
505a2921fa
Exists in
master
and in
8 other branches
增加权限
Showing 1 changed file with 66 additions and 72 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/VisitAddRequest.java
View file @
b0cc54f
1 | 1 | package com.lyms.platform.operate.web.request; |
2 | 2 | |
3 | -import java.util.Date; | |
4 | -import java.util.Map; | |
5 | - | |
6 | -import javax.validation.constraints.Max; | |
7 | -import javax.validation.constraints.Min; | |
8 | -import javax.validation.constraints.NotNull; | |
9 | - | |
10 | -import com.lyms.platform.pojo.Patients; | |
11 | -import org.hibernate.validator.constraints.NotEmpty; | |
12 | - | |
13 | -import com.lyms.platform.common.core.annotation.form.Form; | |
14 | 3 | import com.lyms.platform.common.core.annotation.form.FormParam; |
15 | 4 | import com.lyms.platform.common.utils.DateUtil; |
16 | 5 | import com.lyms.platform.common.utils.JsonUtil; |
6 | +import com.lyms.platform.pojo.Patients; | |
17 | 7 | import com.lyms.platform.pojo.PuerperaModel; |
18 | 8 | import com.lyms.platform.pojo.VisitModel; |
9 | +import org.hibernate.validator.constraints.NotEmpty; | |
19 | 10 | |
11 | +import java.util.Date; | |
12 | +import java.util.Map; | |
13 | + | |
20 | 14 | /** |
21 | 15 | * 访视记录请求 |
22 | - * | |
16 | + * | |
23 | 17 | * @author Administrator |
24 | 18 | */ |
25 | 19 | //@Form |
... | ... | @@ -41,10 +35,7 @@ |
41 | 35 | /** |
42 | 36 | * 产妇年龄 |
43 | 37 | */ |
44 | - @NotNull(message = "年龄不能为空") | |
45 | - @Min(value = 1, message = "年龄不能小于1") | |
46 | - @Max(value = 50, message = "年龄不能大于50") | |
47 | - private int age; | |
38 | + private String age; | |
48 | 39 | |
49 | 40 | /** |
50 | 41 | * 产妇身份证号码 |
... | ... | @@ -76,7 +67,7 @@ |
76 | 67 | */ |
77 | 68 | private String address; |
78 | 69 | |
79 | - private int provinceId; | |
70 | + private int provinceId; | |
80 | 71 | private int cityId; |
81 | 72 | private int areaId; |
82 | 73 | |
... | ... | @@ -181,6 +172,16 @@ |
181 | 172 | */ |
182 | 173 | private String other; |
183 | 174 | |
175 | + private String phone; | |
176 | + | |
177 | + public String getPhone() { | |
178 | + return phone; | |
179 | + } | |
180 | + | |
181 | + public void setPhone(String phone) { | |
182 | + this.phone = phone; | |
183 | + } | |
184 | + | |
184 | 185 | /** |
185 | 186 | * 指导 |
186 | 187 | */ |
187 | 188 | |
... | ... | @@ -216,11 +217,11 @@ |
216 | 217 | this.name = name; |
217 | 218 | } |
218 | 219 | |
219 | - public int getAge() { | |
220 | + public String getAge() { | |
220 | 221 | return age; |
221 | 222 | } |
222 | 223 | |
223 | - public void setAge(int age) { | |
224 | + public void setAge(String age) { | |
224 | 225 | this.age = age; |
225 | 226 | } |
226 | 227 | |
... | ... | @@ -265,7 +266,6 @@ |
265 | 266 | }*/ |
266 | 267 | |
267 | 268 | |
268 | - | |
269 | 269 | public String getNumOfLive() { |
270 | 270 | return numOfLive; |
271 | 271 | } |
272 | 272 | |
273 | 273 | |
274 | 274 | |
275 | 275 | |
... | ... | @@ -465,21 +465,34 @@ |
465 | 465 | puerperaModel.setProvinceId(provinceId); |
466 | 466 | puerperaModel.setId(parentId); |
467 | 467 | puerperaModel.setName(name); |
468 | - puerperaModel.setAge(age); | |
468 | + try { | |
469 | + Date date = DateUtil.parseYMD(age); | |
470 | + puerperaModel.setAge(DateUtil.getAge(date)); | |
471 | + }catch (Exception e){} | |
472 | + | |
473 | + | |
469 | 474 | puerperaModel.setCardno(cardNo); |
470 | 475 | puerperaModel.setDueDate(dueDate); |
471 | 476 | puerperaModel.setDeliverOrg(deliverOrg); |
472 | 477 | puerperaModel.setDueType(dueType); |
473 | 478 | puerperaModel.setAddress(address); |
479 | + puerperaModel.setPhone(phone); | |
474 | 480 | return puerperaModel; |
475 | 481 | } |
482 | + | |
476 | 483 | public Patients getPatients() { |
477 | 484 | Patients patients = new Patients(); |
478 | 485 | patients.setId(parentId); |
479 | 486 | patients.setUsername(name); |
480 | - patients.setAge(age); | |
487 | + try { | |
488 | + Date date = DateUtil.parseYMD(age); | |
489 | + patients.setAge(DateUtil.getAge(date)); | |
490 | + patients.setBirth(date); | |
491 | + } catch (Exception e) { | |
492 | + | |
493 | + } | |
481 | 494 | patients.setCardNo(cardNo); |
482 | - patients.setPhone(cardNo); | |
495 | + patients.setPhone(phone); | |
483 | 496 | patients.setDueDate(new Date()); |
484 | 497 | patients.setDeliverOrg(deliverOrg); |
485 | 498 | patients.setDueType(dueType); |
... | ... | @@ -487,7 +500,7 @@ |
487 | 500 | patients.setAreaId(areaId); |
488 | 501 | patients.setCityId(cityId); |
489 | 502 | patients.setProvinceId(provinceId); |
490 | - return patients; | |
503 | + return patients; | |
491 | 504 | } |
492 | 505 | |
493 | 506 | public VisitModel getRequestVisit() { |
... | ... | @@ -502,7 +515,7 @@ |
502 | 515 | |
503 | 516 | visit.setBreast(breast); |
504 | 517 | visit.setChecktime(checktime); |
505 | - visit.setDays((DateUtil.getDays(DateUtil.parseYMD(dueDate), DateUtil.parseYMD(checktime))+1) + ""); | |
518 | + visit.setDays((DateUtil.getDays(DateUtil.parseYMD(dueDate), DateUtil.parseYMD(checktime)) + 1) + ""); | |
506 | 519 | visit.setDoctorsign(doctorsign); |
507 | 520 | visit.setDue(due); |
508 | 521 | visit.setHealth(health); |
509 | 522 | |
... | ... | @@ -525,10 +538,10 @@ |
525 | 538 | * 详细描述 |
526 | 539 | * <p> |
527 | 540 | * 示例代码 |
528 | - * | |
541 | + * <p> | |
529 | 542 | * <pre> |
530 | 543 | * </pre> |
531 | - * | |
544 | + * | |
532 | 545 | * @author In_Home |
533 | 546 | * @version BME V100R001 2016-3-21 |
534 | 547 | * @since BME V100R001C40B104 |
535 | 548 | |
... | ... | @@ -550,10 +563,20 @@ |
550 | 563 | |
551 | 564 | private String address; |
552 | 565 | |
553 | - private int provinceId; | |
566 | + private int provinceId; | |
554 | 567 | private int cityId; |
555 | 568 | private int areaId; |
556 | 569 | |
570 | + private String phone; | |
571 | + | |
572 | + public String getPhone() { | |
573 | + return phone; | |
574 | + } | |
575 | + | |
576 | + public void setPhone(String phone) { | |
577 | + this.phone = phone; | |
578 | + } | |
579 | + | |
557 | 580 | public int getAreaId() { |
558 | 581 | return areaId; |
559 | 582 | } |
560 | 583 | |
561 | 584 | |
562 | 585 | |
563 | 586 | |
564 | 587 | |
565 | 588 | |
... | ... | @@ -581,33 +604,35 @@ |
581 | 604 | public SimpleVisitPuerpera() { |
582 | 605 | } |
583 | 606 | |
584 | - public SimpleVisitPuerpera(PuerperaModel model) { | |
607 | + /* public SimpleVisitPuerpera(PuerperaModel model) { | |
585 | 608 | id = model.getId(); |
586 | 609 | name = model.getName(); |
587 | - age = model.getAge(); | |
610 | +// age = model.getAge(); | |
588 | 611 | cardno = model.getCardNo(); |
589 | 612 | dueDate = DateUtil.getyyyy_MM_dd(model.getDueDate()); |
590 | 613 | deliverOrg = model.getDeliverOrg(); |
591 | 614 | dueType = model.getDueType(); |
592 | 615 | address = model.getAddress(); |
593 | 616 | // cityId =model.getc |
594 | - } | |
617 | + }*/ | |
618 | + | |
595 | 619 | public SimpleVisitPuerpera(Patients model) { |
596 | 620 | id = model.getId(); |
597 | 621 | name = model.getUsername(); |
598 | 622 | try { |
599 | 623 | age = model.getAge(); |
600 | - }catch (Exception e){ | |
624 | + } catch (Exception e) { | |
601 | 625 | } |
626 | + phone = model.getPhone(); | |
602 | 627 | cardno = model.getCardNo(); |
603 | 628 | dueDate = DateUtil.getyyyy_MM_dd(model.getDueDate()); |
604 | 629 | deliverOrg = model.getDeliverOrg(); |
605 | 630 | dueType = model.getDueType(); |
606 | 631 | address = model.getAddress(); |
607 | - cityId=model | |
632 | + cityId = model | |
608 | 633 | .getCityId(); |
609 | - areaId=model.getAreaId(); | |
610 | - provinceId=model.getProvinceId(); | |
634 | + areaId = model.getAreaId(); | |
635 | + provinceId = model.getProvinceId(); | |
611 | 636 | } |
612 | 637 | |
613 | 638 | public String getId() { |
614 | 639 | |
615 | 640 | |
616 | 641 | |
... | ... | @@ -733,48 +758,17 @@ |
733 | 758 | if (name == null) { |
734 | 759 | if (other.name != null) return false; |
735 | 760 | } else if (!name.equals(other.name)) return false; |
736 | - if(((SimpleVisitPuerpera) obj).provinceId !=provinceId){ | |
737 | - return false; | |
761 | + if (((SimpleVisitPuerpera) obj).provinceId != provinceId) { | |
762 | + return false; | |
738 | 763 | } |
739 | - if(((SimpleVisitPuerpera) obj).cityId !=cityId){ | |
740 | - return false; | |
764 | + if (((SimpleVisitPuerpera) obj).cityId != cityId) { | |
765 | + return false; | |
741 | 766 | } |
742 | - if(((SimpleVisitPuerpera) obj).areaId !=areaId){ | |
743 | - return false; | |
767 | + if (((SimpleVisitPuerpera) obj).areaId != areaId) { | |
768 | + return false; | |
744 | 769 | } |
745 | 770 | return true; |
746 | 771 | } |
747 | - } | |
748 | - | |
749 | - public static void main(String[] args) { | |
750 | - SimpleVisitPuerpera puerpera = new VisitAddRequest().new SimpleVisitPuerpera(); | |
751 | - puerpera.setAddress("天府2街"); | |
752 | - puerpera.setAge(1); | |
753 | - puerpera.setCardno("500311932121545"); | |
754 | - puerpera.setDeliverOrg("西财华西"); | |
755 | - puerpera.setDueDate("2015-05-06"); | |
756 | - puerpera.setDueType("剖腹"); | |
757 | - puerpera.setId("11"); | |
758 | - puerpera.setName("查房"); | |
759 | - | |
760 | - PuerperaModel model = new PuerperaModel(); | |
761 | - model.setAddress("天府2街"); | |
762 | - model.setAge(1); | |
763 | - model.setCardNo("500311932121545"); | |
764 | - model.setDeliverOrg("西财华西"); | |
765 | - model.setDueDate(DateUtil.parseYMD("2015-05-07")); | |
766 | - model.setDueType("剖腹"); | |
767 | - model.setId("11"); | |
768 | - model.setName("查房1"); | |
769 | - System.out.println(puerpera.equals(new VisitAddRequest().new SimpleVisitPuerpera(model))); | |
770 | - | |
771 | - VisitAddRequest visitAddRequest = new VisitAddRequest(); | |
772 | -// visitAddRequest.setAddress("测试"); | |
773 | - visitAddRequest.setAge(1); | |
774 | -// visitAddRequest.setBp("{}"); | |
775 | - visitAddRequest.setCardNo("454646465456465456"); | |
776 | - visitAddRequest.setBreast("fafffaffaffa"); | |
777 | - System.out.print(JsonUtil.obj2JsonString(visitAddRequest)); | |
778 | 772 | } |
779 | 773 | } |