Commit 5a7bbb355c1f4288470f00067afea35bad5d99f3

Authored by liquanyu
1 parent 7adb6d41c0

分娩

Showing 5 changed files with 114 additions and 4 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java View file @ 5a7bbb3
... ... @@ -7413,8 +7413,77 @@
7413 7413 }
7414 7414  
7415 7415  
  7416 + public static void saveInout(String fileName) {
  7417 + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml");
  7418 + MongoTemplate mongoTemplate
  7419 + = (MongoTemplate) applicationContext.getBean("mongoTemplate");
  7420 + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray());
  7421 + File file = new File(fileName);
  7422 + Workbook wb = null;
  7423 + try {
  7424 + wb = Workbook.getWorkbook(file);
  7425 +
  7426 + Sheet s = wb.getSheet(0);
  7427 + System.out.println(s.getName() + " : ");
  7428 + int rows = s.getRows();
  7429 + if (rows > 0) {
  7430 + //遍历每行
  7431 + for (int i = 1; i < rows; i++) {
  7432 + System.out.println("rows=" + i);
  7433 + PatientRegistrationModel model = new PatientRegistrationModel();
  7434 + model.setHospitalId("216");
  7435 + model.setType("1");
  7436 + model.setOutType(1);
  7437 + model.setModifyDate(new Date());
  7438 + model.setYn(1);
  7439 + Cell[] cells = s.getRow(i);
  7440 + if (cells.length > 0) {
  7441 + for (int j = 0; j < cells.length; j++) {
  7442 +
  7443 + String str = cells[j].getContents().trim();
  7444 + switch (j) {
  7445 + case 0:
  7446 + model.setName(str);
  7447 + continue;
  7448 + case 1:
  7449 + model.setPhone(str);
  7450 + continue;
  7451 + case 2:
  7452 + model.setCardno(str);
  7453 + continue;
  7454 + case 3:
  7455 + if ("LDRP(家庭化产房)".equals(str))
  7456 + {
  7457 + model.setBedType(1);
  7458 + }else if ("普通房间(产前) +单人分娩产房 +单人间(产后)".equals(str))
  7459 + {
  7460 + model.setBedType(2);
  7461 + }else if ("普通房间(产前+产后)".equals(str))
  7462 + {
  7463 + model.setBedType(3);
  7464 + }
  7465 + continue;
  7466 + case 4:
  7467 + model.setCreateDate(DateUtil.parseYMDHMS(str));
  7468 + continue;
  7469 + case 5:
  7470 + model.setOrderDate(DateUtil.pareYyyy_MM_dd1(str));
  7471 + continue;
  7472 + }
  7473 + }
  7474 + }
  7475 + //mongoTemplate.save(model);
  7476 + System.out.println(model);
  7477 + }
  7478 + }
  7479 + } catch (Exception e) {
  7480 + e.printStackTrace();
  7481 + }
  7482 + }
  7483 +
7416 7484 public static void main(String[] args) {
7417   - compareYqys("C:\\Users\\liquanyu\\Desktop\\doc\\temp\\联网.xls","C:\\Users\\liquanyu\\Desktop\\doc\\temp\\单机.xls");
  7485 + saveInout("C:\\Users\\liquanyu\\Desktop\\doc\\temp\\预约.xls");
  7486 + // compareYqys("C:\\Users\\liquanyu\\Desktop\\doc\\temp\\联网.xls","C:\\Users\\liquanyu\\Desktop\\doc\\temp\\单机.xls");
7418 7487 //saveGw("C:\\Users\\liquanyu\\Desktop\\doc\\承德工位\\承德工位机构表.xls","C:\\Users\\liquanyu\\Desktop\\doc\\承德工位\\龙源承德机构表.xls");
7419 7488 //savePreeugenicsAddr("C:\\Users\\liquanyu\\Desktop\\doc\\孕前优生上传省平台\\隆化妇幼保健院孕前上传正式\\承德区划对照表.xls");
7420 7489 // dic();
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java View file @ 5a7bbb3
... ... @@ -688,6 +688,17 @@
688 688 }
689 689 }
690 690  
  691 + public static Date pareYyyy_MM_dd1(String d) {
  692 + if (d == null) {
  693 + return null;
  694 + }
  695 + try {
  696 + return y_m_d1.parse(d);
  697 + } catch (Exception e) {
  698 + return null;
  699 + }
  700 + }
  701 +
691 702 public static String getMMdd(Date d) {
692 703 if (d == null) {
693 704 return null;
... ... @@ -1925,7 +1936,7 @@
1925 1936 // BigDecimal bg = new BigDecimal(1.0/30*a);
1926 1937 // double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
1927 1938 //
1928   -// System.out.println(f1);
  1939 + System.out.println(DateUtil.getyyyy_MM_dd_hms(DateUtil.parseYMDHMS("2022-8-4 9:49:48")));
1929 1940 }
1930 1941  
1931 1942 }
platform-dal/src/main/java/com/lyms/platform/pojo/PatientRegistrationModel.java View file @ 5a7bbb3
... ... @@ -34,7 +34,16 @@
34 34 //预约时间
35 35 private Date orderDate;
36 36  
  37 + //是否出院 1未出院 2出院
  38 + private Integer outType;
37 39  
  40 + public Integer getOutType() {
  41 + return outType;
  42 + }
  43 +
  44 + public void setOutType(Integer outType) {
  45 + this.outType = outType;
  46 + }
38 47  
39 48 public String getId() {
40 49 return id;
platform-dal/src/main/java/com/lyms/platform/query/PatientRegistrationModelQuery.java View file @ 5a7bbb3
... ... @@ -40,8 +40,9 @@
40 40 //登记时间
41 41 private Date createDateStart;
42 42 private Date createDateEnd;
  43 + //是否出院 1未出院 2出院
  44 + private Integer outType;
43 45  
44   -
45 46 @Override
46 47 public MongoQuery convertToQuery() {
47 48 MongoCondition condition = MongoCondition.newInstance();
... ... @@ -50,6 +51,10 @@
50 51  
51 52 condition = condition.and("name", name, MongoOper.IS);
52 53 }
  54 + if (outType == null) {
  55 +
  56 + condition = condition.and("outType", outType, MongoOper.IS);
  57 + }
53 58 // 就诊卡号
54 59 if (StringUtils.isNotEmpty(phone)) {
55 60  
... ... @@ -119,6 +124,13 @@
119 124 return condition.toMongoQuery();
120 125 }
121 126  
  127 + public Integer getOutType() {
  128 + return outType;
  129 + }
  130 +
  131 + public void setOutType(Integer outType) {
  132 + this.outType = outType;
  133 + }
122 134  
123 135 public Integer getBedType() {
124 136 return bedType;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PatientRegistrationResult.java View file @ 5a7bbb3
... ... @@ -22,7 +22,8 @@
22 22 private String bedType;
23 23 //预约时间
24 24 private String orderDate;
25   -
  25 + //是否出院 1未出院 2出院
  26 + private Integer outType;
26 27 @Override
27 28 public PatientRegistrationResult convertToResult(PatientRegistrationModel destModel) {
28 29 setCreateDate(DateUtil.getyyyy_MM_dd_hms(destModel.getCreateDate()));
29 30  
... ... @@ -32,9 +33,17 @@
32 33 setType(destModel.getType() == null ? "" : ("1".equals(destModel.getType()) ? "是" : "否" ));
33 34 setBedType(destModel.getBedType() == null ? "" : (destModel.getBedType() == 1 ? "LDRP(家庭化产房)" : (destModel.getBedType() == 2 ? "普通房间(产前)+单人分娩产房+单间(产后)" : "普通房间(产前+产后)")));
34 35 setOrderDate(DateUtil.getYyyyMmDd(destModel.getOrderDate()));
  36 + setOutType(destModel.getOutType());
35 37 return this;
36 38 }
37 39  
  40 + public Integer getOutType() {
  41 + return outType;
  42 + }
  43 +
  44 + public void setOutType(Integer outType) {
  45 + this.outType = outType;
  46 + }
38 47  
39 48 public String getId() {
40 49 return id;