lantone 5 years ago
parent
commit
3af24a6b38
36 changed files with 2737 additions and 88 deletions
  1. 12 4
      pom.xml
  2. 109 0
      src/main/java/com/diagbot/dto/FBehospitalInfoDTO.java
  3. 129 0
      src/main/java/com/diagbot/dto/FDoctorAdviceDTO.java
  4. 638 0
      src/main/java/com/diagbot/dto/FHomePageDTO.java
  5. 28 0
      src/main/java/com/diagbot/dto/FMedicalRecordContentDTO.java
  6. 38 0
      src/main/java/com/diagbot/dto/FMedicalRecordDTO.java
  7. 36 0
      src/main/java/com/diagbot/dto/FMedicalRecordTypeDTO.java
  8. 167 0
      src/main/java/com/diagbot/entity/BasDeptInfo.java
  9. 154 0
      src/main/java/com/diagbot/entity/BasDoctorInfo.java
  10. 22 0
      src/main/java/com/diagbot/facade/BasDeptInfoFacade.java
  11. 22 0
      src/main/java/com/diagbot/facade/BasDoctorInfoFacade.java
  12. 118 43
      src/main/java/com/diagbot/facade/DataFacade.java
  13. 12 0
      src/main/java/com/diagbot/facade/HomeDiagnoseInfoFacade.java
  14. 16 0
      src/main/java/com/diagbot/mapper/BasDeptInfoMapper.java
  15. 16 0
      src/main/java/com/diagbot/mapper/BasDoctorInfoMapper.java
  16. 16 0
      src/main/java/com/diagbot/service/BasDeptInfoService.java
  17. 16 0
      src/main/java/com/diagbot/service/BasDoctorInfoService.java
  18. 20 0
      src/main/java/com/diagbot/service/impl/BasDeptInfoServiceImpl.java
  19. 20 0
      src/main/java/com/diagbot/service/impl/BasDoctorInfoServiceImpl.java
  20. 69 0
      src/main/java/com/diagbot/task/BasDeptInfoTask.java
  21. 69 0
      src/main/java/com/diagbot/task/BasDoctorInfoTask.java
  22. 68 0
      src/main/java/com/diagbot/task/HomeDiagnoseInfoTask.java
  23. 115 34
      src/main/java/com/diagbot/util/DBConn.java
  24. 600 0
      src/main/java/com/diagbot/util/TZDBConn.java
  25. 43 0
      src/main/java/com/diagbot/vo/FBasDeptInfoVO.java
  26. 38 0
      src/main/java/com/diagbot/vo/FBasDoctorInfoVO.java
  27. 5 0
      src/main/java/com/diagbot/vo/FBehospitalInfoVO.java
  28. 7 0
      src/main/java/com/diagbot/vo/FHomeDiagnoseVO.java
  29. 5 0
      src/main/java/com/diagbot/vo/FHomeOperationVO.java
  30. 6 0
      src/main/java/com/diagbot/vo/FMedicalRecordContentVO.java
  31. 7 0
      src/main/java/com/diagbot/vo/FMedicalRecordVO.java
  32. 75 5
      src/main/java/com/diagbot/web/DataController.java
  33. 1 1
      src/main/resources/application-local.yml
  34. 20 0
      src/main/resources/mapper/BasDeptInfoMapper.xml
  35. 19 0
      src/main/resources/mapper/BasDoctorInfoMapper.xml
  36. 1 1
      src/test/java/com/diagbot/CodeGeneration.java

+ 12 - 4
pom.xml

@@ -184,10 +184,18 @@
         </dependency>
        
        <dependency>
-      <groupId>com.oracle</groupId>
-      <artifactId>ojdbc6</artifactId>
-      <version>11.2.0.3</version>
-    </dependency>
+	      <groupId>com.oracle</groupId>
+	      <artifactId>ojdbc6</artifactId>
+	      <version>11.2.0.3</version>
+	    </dependency>
+    
+    	<dependency>
+			<groupId>com.microsoft.sqlserver</groupId>
+			<artifactId>mssql-jdbc</artifactId>
+			<version>6.2.0.jre8</version>
+			<scope>runtime</scope>
+		</dependency>
+
     </dependencies>
 
     <!-- 私有仓库 -->

+ 109 - 0
src/main/java/com/diagbot/dto/FBehospitalInfoDTO.java

@@ -0,0 +1,109 @@
+package com.diagbot.dto;
+
+import java.util.Date;
+
+import lombok.Data;
+
+@Data
+public class FBehospitalInfoDTO{
+
+	/**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医院ID
+     */
+    private String hospitalId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    private Date birthday;
+
+    /**
+     * 档案号
+     */
+    private String fileCode;
+
+    /**
+     * 病区编码
+     */
+    private String wardCode;
+
+    /**
+     * 病区名称
+     */
+    private String wardName;
+
+    /**
+     * 住院科室ID
+     */
+    private String behDeptId;
+
+    /**
+     * 住院科室名称
+     */
+    private String behDeptName;
+
+    /**
+     * 床位号
+     */
+    private String bedCode;
+
+    /**
+     * 床位名称
+     */
+    private String bedName;
+
+    /**
+     * 医保类别
+     */
+    private String insuranceName;
+
+    /**
+     * 职业
+     */
+    private String jobType;
+
+    /**
+     * 入院时间
+     */
+    private Date behospitalDate;
+
+    /**
+     * 出院时间
+     */
+    private Date leaveHospitalDate;
+
+    /**
+     * 疾病ICD编码
+     */
+    private String diagnoseIcd;
+
+    /**
+     * 疾病名称
+     */
+    private String diagnose;
+
+    /**
+     * 医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 医生姓名
+     */
+    private String doctorName;
+}

+ 129 - 0
src/main/java/com/diagbot/dto/FDoctorAdviceDTO.java

@@ -0,0 +1,129 @@
+package com.diagbot.dto;
+
+import java.util.Date;
+
+import lombok.Data;
+
+@Data
+public class FDoctorAdviceDTO {
+
+	/**
+     * 病人医嘱ID
+     */
+    private String doctorAdviceId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 医生开单判别
+     */
+    private String orderDoctorName;
+
+    /**
+     * 医嘱频率判别
+     */
+    private String frequency;
+
+    /**
+     * 父类医嘱ID
+     */
+    private String parentTypeId;
+
+    /**
+     * 医嘱类型判别(嘱托长嘱、长期医嘱等)
+     */
+    private String doctorAdviceType;
+
+    /**
+     * 一次使用数量
+     */
+    private String usageNum;
+
+    /**
+     * 一次用量单位
+     */
+    private String usageUnit;
+
+    /**
+     * 医嘱单次剂量
+     */
+    private String dose;
+
+    /**
+     * 单次剂量单位
+     */
+    private String doseUnit;
+
+    /**
+     * 给药方式
+     */
+    private String medModeType;
+
+    /**
+     * 医嘱频率
+     */
+    private String daFrequency;
+
+    /**
+     * 医嘱处理类型
+     */
+    private String daDealType;
+
+    /**
+     * 医嘱开始时间
+     */
+    private Date daStartDate;
+
+    /**
+     * 医嘱项目名称
+     */
+    private String daItemName;
+
+    /**
+     * 医嘱状态判别
+     */
+    private String daStatus;
+
+    /**
+     * 医嘱结束时间
+     */
+    private Date daStopDate;
+
+    /**
+     * 医嘱同组序号
+     */
+    private String daGroupNo;
+
+    /**
+     * 医嘱处方类型(检验、描述医嘱、膳食、西药、护理等)
+     */
+    private String daPrescriptionType;
+
+    /**
+     * 医嘱领药类型
+     */
+    private String daMedType;
+
+    /**
+     * 医生嘱托
+     */
+    private String doctorNotice;
+
+    /**
+     * 开单医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 开单医生姓名
+     */
+    private String doctorName;
+}

+ 638 - 0
src/main/java/com/diagbot/dto/FHomePageDTO.java

@@ -1,5 +1,643 @@
 package com.diagbot.dto;
 
+import java.util.Date;
+
+import lombok.Data;
+
+@Data
 public class FHomePageDTO {
+	/**
+     * 病案首页编号
+     */
+    private String homePageId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院序号
+     */
+    private String behospitalCode;
+
+    /**
+     * 组织机构id
+     */
+    private String hospitalCode;
+
+    /**
+     * 医疗机构名称
+     */
+    private String hospitalName;
+
+    /**
+     * 医疗机构代码
+     */
+    private String orgCode;
+
+    /**
+     * 医疗付费方式
+     */
+    private String payType;
+
+    /**
+     * 健康卡号
+     */
+    private String healthCard;
+
+    /**
+     * 住院次数
+     */
+    private String behospitalNum;
+
+    /**
+     * 病案号
+     */
+    private String fileCode;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 出生日期
+     */
+    private Date birthday;
+
+    /**
+     * 年龄
+     */
+    private String age;
+
+    /**
+     * 年龄单位
+     */
+    private String ageUnit;
+
+    /**
+     * 国籍
+     */
+    private String nationality;
+
+    /**
+     * 新生儿出生月数
+     */
+    private String newbornMonth;
+
+    /**
+     * 新生儿出生天数
+     */
+    private String newbornDay;
+
+    /**
+     * 新生儿出生体重
+     */
+    private String newbornWeight;
+
+    /**
+     * 新生儿入院体重
+     */
+    private String newbornBehospitalWeight;
+
+    /**
+     * 出生地
+     */
+    private String bornAddress;
+
+    /**
+     * 籍贯
+     */
+    private String bornPlace;
+
+    /**
+     * 民族
+     */
+    private String nation;
+
+    /**
+     * 身份证号
+     */
+    private String identityCardNo;
+
+    /**
+     * 职业
+     */
+    private String jobType;
+
+    /**
+     * 婚姻
+     */
+    private String marriage;
+
+    /**
+     * 现住址
+     */
+    private String curAddress;
+
+    /**
+     * 现住址电话
+     */
+    private String curPhone;
+
+    /**
+     * 现住址邮编
+     */
+    private String curPostCode;
+
+    /**
+     * 户口地址
+     */
+    private String residenceAddress;
+
+    /**
+     * 户口地址邮编
+     */
+    private String residencePostCode;
+
+    /**
+     * 工作单位
+     */
+    private String workAddress;
+
+    /**
+     * 工作单位电话
+     */
+    private String workPhone;
+
+    /**
+     * 工作单位邮编
+     */
+    private String workPostCode;
+
+    /**
+     * 联系人姓名
+     */
+    private String contactName;
+
+    /**
+     * 联系人关系
+     */
+    private String contactRelation;
+
+    /**
+     * 联系人地址
+     */
+    private String contactAddress;
+
+    /**
+     * 联系人电话
+     */
+    private String contactPhone;
+
+    /**
+     * 入院途径
+     */
+    private String behospitalWay;
+
+    /**
+     * 入院时间
+     */
+    private Date behospitalDate;
+
+    /**
+     * 入院科别
+     */
+    private String behospitalDept;
+
+    /**
+     * 入院病房
+     */
+    private String behospitalWard;
+
+    /**
+     * 入院床位序号
+     */
+    private String behospitalBedId;
+
+    /**
+     * 入院床位号码
+     */
+    private String behospitalBedCode;
+
+    /**
+     * 转科科别
+     */
+    private String changeDept;
+
+    /**
+     * 出院时间
+     */
+    private Date leaveHospitalDate;
+
+    /**
+     * 出院科别
+     */
+    private String leaveHospitalDept;
+
+    /**
+     * 出院病房
+     */
+    private String leaveHospitalWard;
+
+    /**
+     * 出院床位序号
+     */
+    private String leaveHospitalBedId;
+
+    /**
+     * 出院床位号码
+     */
+    private String leaveHospitalBedCode;
+
+    /**
+     * 实际住院天数
+     */
+    private String behospitalDayNum;
+
+    /**
+     * 门急诊诊断
+     */
+    private String outpatientEmrDiagnose;
+
+    /**
+     * 门急诊诊断编码
+     */
+    private String outpatientEmrDiagnoseCode;
+
+    /**
+     * 损伤中毒因素
+     */
+    private String poisonFactor;
+
+    /**
+     * 损伤中毒因素编码
+     */
+    private String poisonFactorCode;
+
+    /**
+     * 病理诊断
+     */
+    private String pathologyDiagnose;
+
+    /**
+     * 病理诊断编码
+     */
+    private String pathologyDiagnoseCode;
+
+    /**
+     * 病理诊断编号
+     */
+    private String pathologyDiagnoseId;
+
+    /**
+     * 药物过敏
+     */
+    private String isMedAllergy;
+
+    /**
+     * 过敏药物
+     */
+    private String medAllergyName;
+
+    /**
+     * 死亡患者尸检
+     */
+    private String autopsy;
+
+    /**
+     * 血型
+     */
+    private String bloodType;
+
+    /**
+     * Rh
+     */
+    private String rh;
+
+    /**
+     * 科主任
+     */
+    private String deptDirector;
+
+    /**
+     * 主任医师
+     */
+    private String directorDoctor;
+
+    /**
+     * 主治医师
+     */
+    private String attendingDoctor;
+
+    /**
+     * 住院医师
+     */
+    private String behospitalDoctor;
+
+    /**
+     * 责任护士
+     */
+    private String responseNurse;
+
+    /**
+     * 进修医师
+     */
+    private String studyDoctor;
+
+    /**
+     * 实习医师
+     */
+    private String practiceDoctor;
+
+    /**
+     * 编码员
+     */
+    private String encodeMan;
+
+    /**
+     * 病案质量
+     */
+    private String homePageQuality;
+
+    /**
+     * 质控医师
+     */
+    private String qcDoctor;
+
+    /**
+     * 质控护士
+     */
+    private String qcNurse;
+
+    /**
+     * 质控日期
+     */
+    private Date qcDate;
+
+    /**
+     * 离院方式
+     */
+    private String leaveHospitalType;
+
+    /**
+     * 接收机构名称
+     */
+    private String acceptOrgCode;
+
+    /**
+     * 31天内再住院计划
+     */
+    private String againBehospitalPlan;
+
+    /**
+     * 再住院目的
+     */
+    private String againBehospitalGoal;
+
+    /**
+     * 颅脑损伤患者昏迷前天数
+     */
+    private String tbiBeforeDay;
+
+    /**
+     * 颅脑损伤患者昏迷前小时
+     */
+    private String tbiBeforeHour;
+
+    /**
+     * 颅脑损伤患者昏迷前分钟
+     */
+    private String tbiBeforeMinute;
+
+    /**
+     * 颅脑损伤患者昏迷后天数
+     */
+    private String tbiAfterDay;
+
+    /**
+     * 颅脑损伤患者昏迷后小时
+     */
+    private String tbiAfterHour;
+
+    /**
+     * 颅脑损伤患者昏迷后分钟
+     */
+    private String tbiAfterMinute;
+
+    /**
+     * 总费用
+     */
+    private String totalFee;
+
+    /**
+     * 自付金额
+     */
+    private String ownFee;
+
+    /**
+     * 一般医疗服务费
+     */
+    private String generalFee;
+
+    /**
+     * 一般治疗服务费
+     */
+    private String serviceFee;
+
+    /**
+     * 护理费
+     */
+    private String nurseFee;
+
+    /**
+     * 其他费用
+     */
+    private String otherFee;
+
+    /**
+     * 病理诊断费
+     */
+    private String pathologyFee;
+
+    /**
+     * 实验室诊断费
+     */
+    private String labFee;
+
+    /**
+     * 影像学诊断费
+     */
+    private String pacsFee;
+
+    /**
+     * 临床诊断项目费
+     */
+    private String clinicDiagnoseFee;
+
+    /**
+     * 非手术治疗项目费
+     */
+    private String notOperationFee;
+
+    /**
+     * 临床物理治疗费
+     */
+    private String clinicPhysicFee;
+
+    /**
+     * 手术治疗费
+     */
+    private String operationTreatFee;
+
+    /**
+     * 麻醉费
+     */
+    private String anaesthesiaFee;
+
+    /**
+     * 手术费
+     */
+    private String operationFee;
+
+    /**
+     * 康复类
+     */
+    private String healthTypeFee;
+
+    /**
+     * 中医治疗费
+     */
+    private String chnTreatFee;
+
+    /**
+     * 西药费
+     */
+    private String westernMedFee;
+
+    /**
+     * 抗菌药物费用
+     */
+    private String antibiosisFee;
+
+    /**
+     * 中成药费
+     */
+    private String chnMedFee;
+
+    /**
+     * 中草药费
+     */
+    private String chnHerbFee;
+
+    /**
+     * 血费
+     */
+    private String bloodFee;
+
+    /**
+     * 白蛋白类制品费
+     */
+    private String albumenFee;
+
+    /**
+     * 球蛋白类制品费
+     */
+    private String globulinFee;
+
+    /**
+     * 凝血因子类制品费
+     */
+    private String bloodFactorFee;
+
+    /**
+     * 细胞因子类制品费
+     */
+    private String cellFactorFee;
+
+    /**
+     * 检查用一次性医用材料费
+     */
+    private String checkMaterialFee;
+
+    /**
+     * 治疗用一次性医用材料费
+     */
+    private String treatMaterialFee;
+
+    /**
+     * 手术用一次性医用材料费
+     */
+    private String operationMaterialFee;
+
+    /**
+     * 其他类其他费
+     */
+    private String otherTypeFee;
+
+    /**
+     * 单病种管理
+     */
+    private String singleDiagManage;
+
+    /**
+     * 临床路径管理
+     */
+    private String clinicPathwayManage;
+
+    /**
+     * 门诊与住院
+     */
+    private String isOutpatientBehospital;
+
+    /**
+     * 入院与出院
+     */
+    private String isLeaveBehospital;
+
+    /**
+     * 术前与术后
+     */
+    private String isOperationBeforeAfter;
+
+    /**
+     * 临床与病理
+     */
+    private String isClinicPathology;
+
+    /**
+     * 放射与病理
+     */
+    private String isRadiatePathology;
+
+    /**
+     * 病人抢救次数
+     */
+    private String rescueNum;
+
+    /**
+     * 病人抢救成功次数
+     */
+    private String rescueSuccessNum;
+
+    /**
+     * 是否为自动出院
+     */
+    private String isAutoLeavehospital;
+
+    /**
+     * 转归情况
+     */
+    private String returnToType;
 
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
 }

+ 28 - 0
src/main/java/com/diagbot/dto/FMedicalRecordContentDTO.java

@@ -0,0 +1,28 @@
+package com.diagbot.dto;
+
+import java.sql.Blob;
+
+import lombok.Data;
+
+@Data
+public class FMedicalRecordContentDTO {
+	/**
+     * 病历ID
+     */
+    private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 文书内容(blob)
+     */
+    private Blob contentBlob;
+
+    /**
+     * 病历文本(文本)
+     */
+    private String contentText;
+}

+ 38 - 0
src/main/java/com/diagbot/dto/FMedicalRecordDTO.java

@@ -0,0 +1,38 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+@Data
+public class FMedicalRecordDTO {
+	private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 组织机构代码
+     */
+    private String orgCode;
+
+    /**
+     * 病历类别编号
+     */
+    private String recTypeId;
+
+    /**
+     * 病历日期
+     */
+    private String recDate;
+
+    /**
+     * 病历标题
+     */
+    private String recTitle;
+}

+ 36 - 0
src/main/java/com/diagbot/dto/FMedicalRecordTypeDTO.java

@@ -0,0 +1,36 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+@Data
+public class FMedicalRecordTypeDTO {
+	/**
+     * 类别ID
+     */
+    private String typeId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 类别名称
+     */
+    private String typeName;
+
+    /**
+     * 上级类别
+     */
+    private String parentTypeId;
+
+    /**
+     * 服务对象(全院、科室、个人)
+     */
+    private String objName;
+
+    /**
+     * 拼音
+     */
+    private String spell;
+}

+ 167 - 0
src/main/java/com/diagbot/entity/BasDeptInfo.java

@@ -0,0 +1,167 @@
+package com.diagbot.entity;
+
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 医院科室信息
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+public class BasDeptInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 科室编码(HIS导入)
+     */
+    private String deptId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 科室名称
+     */
+    private String deptName;
+
+    /**
+     * 科室类别
+     */
+    private String deptType;
+
+    /**
+     * 首字母拼音
+     */
+    private String spell;
+
+    /**
+     * 区域类别(门诊、工作站、住院等)
+     */
+    private String station;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    public String getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(String deptId) {
+        this.deptId = deptId;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+    public String getDeptType() {
+        return deptType;
+    }
+
+    public void setDeptType(String deptType) {
+        this.deptType = deptType;
+    }
+    public String getSpell() {
+        return spell;
+    }
+
+    public void setSpell(String spell) {
+        this.spell = spell;
+    }
+    public String getStation() {
+        return station;
+    }
+
+    public void setStation(String station) {
+        this.station = station;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public LocalDateTime getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(LocalDateTime gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public LocalDateTime getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(LocalDateTime gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    @Override
+    public String toString() {
+        return "BasDeptInfo{" +
+            "deptId=" + deptId +
+            ", hospitalId=" + hospitalId +
+            ", deptName=" + deptName +
+            ", deptType=" + deptType +
+            ", spell=" + spell +
+            ", station=" + station +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+        "}";
+    }
+}

+ 154 - 0
src/main/java/com/diagbot/entity/BasDoctorInfo.java

@@ -0,0 +1,154 @@
+package com.diagbot.entity;
+
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+public class BasDoctorInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * HIS导入的医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院导入科室ID
+     */
+    private String deptId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 职称
+     */
+    private String professor;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    public String getDoctorId() {
+        return doctorId;
+    }
+
+    public void setDoctorId(String doctorId) {
+        this.doctorId = doctorId;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(String deptId) {
+        this.deptId = deptId;
+    }
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+    public String getProfessor() {
+        return professor;
+    }
+
+    public void setProfessor(String professor) {
+        this.professor = professor;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public LocalDateTime getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(LocalDateTime gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public LocalDateTime getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(LocalDateTime gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    @Override
+    public String toString() {
+        return "BasDoctorInfo{" +
+            "doctorId=" + doctorId +
+            ", hospitalId=" + hospitalId +
+            ", deptId=" + deptId +
+            ", name=" + name +
+            ", professor=" + professor +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+        "}";
+    }
+}

+ 22 - 0
src/main/java/com/diagbot/facade/BasDeptInfoFacade.java

@@ -0,0 +1,22 @@
+package com.diagbot.facade;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.service.impl.BasDeptInfoServiceImpl;
+import com.diagbot.util.DBConn;
+
+@Component
+public class BasDeptInfoFacade extends BasDeptInfoServiceImpl{
+	
+	@Autowired
+	private BasDeptInfoServiceImpl basDeptInfoServiceImpl;
+	
+	public void executeTZ() {
+		List<BasDeptInfo> basDeptInfoList=DBConn.getDeptInfo();
+		basDeptInfoServiceImpl.saveBatch(basDeptInfoList);
+	}
+}

+ 22 - 0
src/main/java/com/diagbot/facade/BasDoctorInfoFacade.java

@@ -0,0 +1,22 @@
+package com.diagbot.facade;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.diagbot.entity.BasDoctorInfo;
+import com.diagbot.service.impl.BasDoctorInfoServiceImpl;
+import com.diagbot.util.DBConn;
+
+@Component
+public class BasDoctorInfoFacade extends BasDoctorInfoServiceImpl {
+	
+	@Autowired
+	private BasDoctorInfoServiceImpl basDoctorInfoServiceImpl;
+	
+	public void executeTZ() {
+		List<BasDoctorInfo> basDeptInfoList=DBConn.getBasDoctorInfo();
+		basDoctorInfoServiceImpl.saveBatch(basDeptInfoList);
+	}
+}

+ 118 - 43
src/main/java/com/diagbot/facade/DataFacade.java

@@ -3,8 +3,13 @@ package com.diagbot.facade;
 import java.util.List;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.entity.BasDoctorInfo;
 import com.diagbot.entity.BehospitalInfo;
 import com.diagbot.entity.DoctorAdvice;
 import com.diagbot.entity.HomeDiagnoseInfo;
@@ -13,126 +18,196 @@ import com.diagbot.entity.HomePage;
 import com.diagbot.entity.MedRecordType;
 import com.diagbot.entity.MedicalRecord;
 import com.diagbot.entity.MedicalRecordContent;
+import com.diagbot.service.impl.BasDeptInfoServiceImpl;
+import com.diagbot.service.impl.BasDoctorInfoServiceImpl;
+import com.diagbot.service.impl.BehospitalInfoServiceImpl;
+import com.diagbot.service.impl.DoctorAdviceServiceImpl;
+import com.diagbot.service.impl.HomeDiagnoseInfoServiceImpl;
+import com.diagbot.service.impl.HomeOperationInfoServiceImpl;
+import com.diagbot.service.impl.HomePageServiceImpl;
+import com.diagbot.service.impl.MedRecordTypeServiceImpl;
+import com.diagbot.service.impl.MedicalRecordContentServiceImpl;
+import com.diagbot.service.impl.MedicalRecordServiceImpl;
 import com.diagbot.util.DBConn;
 
 @Component
 public class DataFacade{
-
+	
 	@Autowired
-	private HomePageFacade homePageFacade;
+	@Qualifier("homePageServiceImpl")
+	private HomePageServiceImpl homePageServiceImpl;
 	
 	@Autowired
-	private BehospitalInfoFacade behospitalInfoFacade;
+	@Qualifier("behospitalInfoServiceImpl")
+	private BehospitalInfoServiceImpl behospitalInfoServiceImpl;
 	
 	@Autowired
-	private DoctorAdviceFacade doctorAdviceFacade;
+	@Qualifier("doctorAdviceServiceImpl")
+	private DoctorAdviceServiceImpl doctorAdviceServiceImpl;
 	
 	@Autowired
-	private MedicalRecordFacade MedicalRecordFacade;
+	@Qualifier("medicalRecordServiceImpl")
+	private MedicalRecordServiceImpl medicalRecordServiceImpl;
 	
 	@Autowired
-	private MedicalRecordContentFacade MedicalRecordContentFacade;
+	@Qualifier("medicalRecordContentServiceImpl")
+	private MedicalRecordContentServiceImpl medicalRecordContentServiceImpl;
 	
 	@Autowired
-	private MedicalRecordTypeFacade MedicalRecordTypeFacade;
+	@Qualifier("medRecordTypeServiceImpl")
+	private MedRecordTypeServiceImpl medRecordTypeServiceImpl;
 	
 	@Autowired
-	private HomeDiagnoseInfoFacade homeDiagnoseInfoFacade;
+	@Qualifier("homeDiagnoseInfoServiceImpl")
+	private HomeDiagnoseInfoServiceImpl homeDiagnoseInfoServiceImpl;
 	
 	@Autowired
-	private HomeOperationInfoFacade homeOperationInfoFacade;
+	@Qualifier("homeOperationInfoServiceImpl")
+	private HomeOperationInfoServiceImpl homeOperationInfoServiceImpl;
 	
-	public Boolean initData() {
+	@Autowired
+	@Qualifier("basDeptInfoServiceImpl")
+	private BasDeptInfoServiceImpl basDeptInfoServiceImpl;
+	
+	@Autowired
+	@Qualifier("basDoctorInfoServiceImpl")
+	private BasDoctorInfoServiceImpl basDoctorInfoServiceImpl;
+	
+	
+	public void initData() {
 		//初始化病案首页
-		//addHomePage();
+		//addHomePage(null);
 		//病案诊断
-		addHomeDiagnose();
+		//addHomeDiagnose(null);
 		//病案手术
-		//addHomeOperation();
+		//addHomeOperation(null);
 		//初始化病历信息
-		//addBehospitalInfo();
+		//addBehospitalInfo(null);
 		//初始化医嘱信息
-		//addDoctorAdvice();
+		//addDoctorAdvice(null);
 		//初始化文书类型
-		//addMedicalRecordType();
+		//addMedicalRecordType(null);
 		//初始化文书基本信息
-		//addMedicalRecord();
+		//addMedicalRecord(null);
 		//初始化文书内容
-		//addMedicalRecordContent();
+		//addMedicalRecordContent(null);
+		
+		 // 6 秒一次:秒 分 时 日 月 周
+	    
+		addDeptInfo(null);
+		
+		//addDoctorInfo(null);
 		
-		return true;
+	}
+	
+	/**
+	 * 医生信息
+	 * @return
+	 */
+	public Boolean addDoctorInfo(List<BasDoctorInfo> basDoctorInfoList) {
+		if(basDoctorInfoList==null || basDoctorInfoList.size()==0){
+			basDoctorInfoList=DBConn.getBasDoctorInfo();
+		}
+		return basDoctorInfoServiceImpl.saveBatch(basDoctorInfoList);
+	}
+	
+	/**
+	 * 科室信息
+	 * @returnDeptInfo
+	 */
+	public Boolean addDeptInfo(List<BasDeptInfo> basDeptInfoList) {
+		if(basDeptInfoList==null || basDeptInfoList.size()==0){
+			basDeptInfoList=DBConn.getDeptInfo();
+		}
+		return basDeptInfoServiceImpl.saveBatch(basDeptInfoList);
 	}
 	
 	/**
 	 * 病案手术
 	 * @return
 	 */
-	public Boolean addHomeOperation() {
-		List<HomeOperationInfo> homeOperationList=DBConn.getHomeOperation();
-		return homeOperationInfoFacade.saveBatch(homeOperationList);
+	public Boolean addHomeOperation(List<HomeOperationInfo> homeOperationList) {
+		if(homeOperationList==null || homeOperationList.size()==0){
+			homeOperationList=DBConn.getHomeOperation();
+		}
+		return homeOperationInfoServiceImpl.saveBatch(homeOperationList);
 	}
 	
 	/**
 	 * 病案诊断
 	 * @return
 	 */
-	public Boolean addHomeDiagnose() {
-		List<HomeDiagnoseInfo> homeDiagnoseList=DBConn.getHomeDiagnose();
-		return homeDiagnoseInfoFacade.saveBatch(homeDiagnoseList);
+	public Boolean addHomeDiagnose(List<HomeDiagnoseInfo> homeDiagnoseList) {
+		if(homeDiagnoseList==null || homeDiagnoseList.size()==0){
+			homeDiagnoseList=DBConn.getHomeDiagnose();
+		}
+		return homeDiagnoseInfoServiceImpl.saveBatch(homeDiagnoseList);
 	}
 	
 	/**
 	 * 从视图中获取文书类型
 	 * @return
 	 */
-	public Boolean addMedicalRecordType() {
-		List<MedRecordType> medicalRecordTypeList=DBConn.getMedicalRecordType();
-		return MedicalRecordTypeFacade.saveBatch(medicalRecordTypeList);
+	public Boolean addMedicalRecordType(List<MedRecordType> medicalRecordTypeList) {
+		if(medicalRecordTypeList==null || medicalRecordTypeList.size()==0){
+			medicalRecordTypeList=DBConn.getMedicalRecordType();
+		}
+		return medRecordTypeServiceImpl.saveBatch(medicalRecordTypeList);
 	}
 	
 	/**
 	 * 从视图中获取文书内容
 	 * @return
 	 */
-	public Boolean addMedicalRecordContent(){
-		List<MedicalRecordContent> medicalRecordContentList=DBConn.getMedicalRecordContent();
-		return MedicalRecordContentFacade.saveBatch(medicalRecordContentList);
+	public Boolean addMedicalRecordContent(List<MedicalRecordContent> medicalRecordContentList){
+		if(medicalRecordContentList==null || medicalRecordContentList.size()==0){
+			medicalRecordContentList=DBConn.getMedicalRecordContent();
+		}
+		return medicalRecordContentServiceImpl.saveBatch(medicalRecordContentList);
 	}
 	
 	/**
 	 * 从视图中获取文书类型
 	 * @return
 	 */
-	public Boolean addMedicalRecord(){
-		List<MedicalRecord> medicalRecordList=DBConn.getMedicalRecord();
-		return MedicalRecordFacade.saveBatch(medicalRecordList);
+	public Boolean addMedicalRecord(List<MedicalRecord> medicalRecordList){
+		if(medicalRecordList==null || medicalRecordList.size()==0){
+			medicalRecordList=DBConn.getMedicalRecord();
+		}
+		return medicalRecordServiceImpl.saveBatch(medicalRecordList);
 	}
 	
 	
 	/**
 	 * 从视图获取病案首页信息
 	 */
-	public Boolean addHomePage() {
-		List<HomePage> homePage=DBConn.getHomePage();
-		return homePageFacade.saveBatch(homePage);
+	public Boolean addHomePage(List<HomePage> homePage) {
+		if(homePage==null || homePage.size()==0){
+			homePage=DBConn.getHomePage();
+		}
+		return homePageServiceImpl.saveBatch(homePage);
 	}
 	
 	/**
 	 * 从视图中获取医嘱信息
 	 * @return
 	 */
-	public Boolean addDoctorAdvice() {
-		List<DoctorAdvice> doctorAdviceList=DBConn.getDoctorAdvice();
-		return doctorAdviceFacade.saveBatch(doctorAdviceList);
+	public Boolean addDoctorAdvice(List<DoctorAdvice> doctorAdviceList) {
+		if(doctorAdviceList==null || doctorAdviceList.size()==0){
+			doctorAdviceList=DBConn.getDoctorAdvice();
+		}
+		return doctorAdviceServiceImpl.saveBatch(doctorAdviceList);
 	}
 	
 	/**
 	 * 获取病历信息
 	 * @return
 	 */
-	public Boolean addBehospitalInfo() {
-		List<BehospitalInfo> behospitalInfoList=DBConn.getBehospitalInfo();
-		return behospitalInfoFacade.saveBatch(behospitalInfoList);
+	public Boolean addBehospitalInfo(List<BehospitalInfo> behospitalInfoList) {
+		if(behospitalInfoList==null || behospitalInfoList.size()==0){
+			behospitalInfoList=DBConn.getBehospitalInfo();
+		}
+		return behospitalInfoServiceImpl.saveBatch(behospitalInfoList);
 	}
 	
 }

+ 12 - 0
src/main/java/com/diagbot/facade/HomeDiagnoseInfoFacade.java

@@ -1,7 +1,12 @@
 package com.diagbot.facade;
 
+import com.diagbot.entity.HomeDiagnoseInfo;
 import com.diagbot.service.impl.HomeDiagnoseInfoServiceImpl;
+import com.diagbot.util.DBConn;
 
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 /**
@@ -12,4 +17,11 @@ import org.springframework.stereotype.Component;
 @Component
 public class HomeDiagnoseInfoFacade extends HomeDiagnoseInfoServiceImpl {
 
+	@Autowired
+	private HomeDiagnoseInfoServiceImpl homeDiagnoseInfoServiceImpl;
+	
+	public void executeTZ() {
+		List<HomeDiagnoseInfo> homeDiagnoseList=DBConn.getHomeDiagnose();
+		homeDiagnoseInfoServiceImpl.saveBatch(homeDiagnoseList);
+	}
 }

+ 16 - 0
src/main/java/com/diagbot/mapper/BasDeptInfoMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.BasDeptInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 医院科室信息 Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+public interface BasDeptInfoMapper extends BaseMapper<BasDeptInfo> {
+
+}

+ 16 - 0
src/main/java/com/diagbot/mapper/BasDoctorInfoMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.BasDoctorInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+public interface BasDoctorInfoMapper extends BaseMapper<BasDoctorInfo> {
+
+}

+ 16 - 0
src/main/java/com/diagbot/service/BasDeptInfoService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.BasDeptInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 医院科室信息 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+public interface BasDeptInfoService extends IService<BasDeptInfo> {
+
+}

+ 16 - 0
src/main/java/com/diagbot/service/BasDoctorInfoService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.BasDoctorInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+public interface BasDoctorInfoService extends IService<BasDoctorInfo> {
+
+}

+ 20 - 0
src/main/java/com/diagbot/service/impl/BasDeptInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.mapper.BasDeptInfoMapper;
+import com.diagbot.service.BasDeptInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 医院科室信息 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+@Service
+public class BasDeptInfoServiceImpl extends ServiceImpl<BasDeptInfoMapper, BasDeptInfo> implements BasDeptInfoService {
+
+}

+ 20 - 0
src/main/java/com/diagbot/service/impl/BasDoctorInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.BasDoctorInfo;
+import com.diagbot.mapper.BasDoctorInfoMapper;
+import com.diagbot.service.BasDoctorInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-04-17
+ */
+@Service
+public class BasDoctorInfoServiceImpl extends ServiceImpl<BasDoctorInfoMapper, BasDoctorInfo> implements BasDoctorInfoService {
+
+}

+ 69 - 0
src/main/java/com/diagbot/task/BasDeptInfoTask.java

@@ -0,0 +1,69 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.BasDeptInfoFacade;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class BasDeptInfoTask implements SchedulingConfigurer{
+
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+    private BasDeptInfoFacade basDeptInfoFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    basDeptInfoFacade.executeTZ();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK002"));
+                String cron = "0/5 * * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 69 - 0
src/main/java/com/diagbot/task/BasDoctorInfoTask.java

@@ -0,0 +1,69 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.BasDeptInfoFacade;
+import com.diagbot.facade.BasDoctorInfoFacade;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class BasDoctorInfoTask implements SchedulingConfigurer{
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+    private BasDoctorInfoFacade basDoctorInfoFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    basDoctorInfoFacade.executeTZ();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK003"));
+                String cron = "0/5 * * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 68 - 0
src/main/java/com/diagbot/task/HomeDiagnoseInfoTask.java

@@ -0,0 +1,68 @@
+package com.diagbot.task;
+
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.Trigger;
+import org.springframework.scheduling.TriggerContext;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.SchedulingConfigurer;
+import org.springframework.scheduling.config.ScheduledTaskRegistrar;
+import org.springframework.scheduling.support.CronTrigger;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.SysTaskCron;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.facade.HomeDiagnoseInfoFacade;
+import com.diagbot.facade.SysTaskCronFacade;
+import com.diagbot.util.StringUtil;
+
+import lombok.extern.slf4j.Slf4j;
+
+@Configuration      //1.主要用于标记配置类,兼备Component的效果。
+@EnableScheduling   // 2.开启定时任务
+@Slf4j
+public class HomeDiagnoseInfoTask implements SchedulingConfigurer{
+	@Autowired
+    private SysTaskCronFacade sysTaskCronFacade;
+
+    private SysTaskCron task001 = new SysTaskCron();
+
+    @Autowired
+    private HomeDiagnoseInfoFacade homeDiagnoseInfoFacade;
+    
+    /**
+     * 执行定时任务.
+     */
+    @Override
+    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
+        taskRegistrar.addTriggerTask(new Runnable() {
+            @Override
+            public void run() {
+                //1.添加任务内容(Runnable)
+                if (null != task001
+                        && task001.getIsDeleted().equals(IsDeleteEnum.N.getKey())
+                        && task001.getIsUsed().equals(1)) {
+                    log.info("执行动态定时任务: " + LocalDateTime.now().toLocalTime());
+                    homeDiagnoseInfoFacade.executeTZ();
+                }
+            }
+        }, new Trigger() {
+            @Override
+            public Date nextExecutionTime(TriggerContext triggerContext) {
+                //2.1 从数据库获取执行周期
+                task001 = sysTaskCronFacade.getOne(new QueryWrapper<SysTaskCron>()
+                        .eq("cron_code", "TASK003"));
+                String cron = "0/5 * * * * ?";
+                //2.2 合法性校验.
+                if (null != task001 && StringUtil.isNotBlank(task001.getCron())) {
+                    cron = task001.getCron();
+                }
+                CronTrigger trigger = new CronTrigger(cron);
+                return trigger.nextExecutionTime(triggerContext);
+            }
+        });
+    }
+}

+ 115 - 34
src/main/java/com/diagbot/util/DBConn.java

@@ -5,9 +5,12 @@ import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
+import java.util.Date;
 import java.util.List;
 import java.util.ResourceBundle;
 
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.entity.BasDoctorInfo;
 import com.diagbot.entity.BehospitalInfo;
 import com.diagbot.entity.DoctorAdvice;
 import com.diagbot.entity.HomeDiagnoseInfo;
@@ -16,6 +19,8 @@ import com.diagbot.entity.HomePage;
 import com.diagbot.entity.MedRecordType;
 import com.diagbot.entity.MedicalRecord;
 import com.diagbot.entity.MedicalRecordContent;
+import com.diagbot.vo.FBasDeptInfoVO;
+import com.diagbot.vo.FBasDoctorInfoVO;
 import com.diagbot.vo.FBehospitalInfoVO;
 import com.diagbot.vo.FDoctorAdviceVO;
 import com.diagbot.vo.FHomeDiagnoseVO;
@@ -151,6 +156,69 @@ public class DBConn {
 		}
 	}
 	
+	/**
+	 * 医生信息
+	 * @return
+	 */
+	public static List<BasDoctorInfo> getBasDoctorInfo() {
+		List<BasDoctorInfo> basDoctorInfoList=Lists.newLinkedList();
+		
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from GI_USERINFO";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				FBasDoctorInfoVO basDoctorInfoVO=new FBasDoctorInfoVO();
+				basDoctorInfoVO.setDoctorId(rs.getString("YHRYBH"));//医生ID
+				basDoctorInfoVO.setHospitalId(Long.valueOf("1"));//医院ID
+				basDoctorInfoVO.setDeptId(rs.getString("ZZKSID"));//科室ID
+				basDoctorInfoVO.setName(rs.getString("YHRYMC"));//医生姓名
+				basDoctorInfoVO.setProfessor(rs.getString("YHRYZC"));//职称
+				
+				BasDoctorInfo basDoctorInfo=new BasDoctorInfo();
+				BeanUtil.copyProperties(basDoctorInfoVO, basDoctorInfo);
+				
+				basDoctorInfoList.add(basDoctorInfo);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		return basDoctorInfoList;
+	}
+	
+	/**
+	 * 科室信息
+	 * @returnDeptInfo
+	 */
+	public static List<BasDeptInfo> getDeptInfo() {
+		List<BasDeptInfo> basDeptInfoList=Lists.newLinkedList();
+		
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from HI_DEPTINFO_CX where XGCZSJ BETWEEN TO_DATE('2020-03-01', 'yyyy-MM-dd') and TO_DATE('2020-03-30', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				FBasDeptInfoVO basDeptInfoVO=new FBasDeptInfoVO();
+				basDeptInfoVO.setDeptId(rs.getString("ZZKSID"));//科室编码
+				basDeptInfoVO.setHospitalId(Long.valueOf("1"));//医院ID
+				basDeptInfoVO.setDeptName(rs.getString("ZZKSMC"));//科室名称
+				basDeptInfoVO.setDeptType(rs.getString("ZZKSLB"));//科室类别
+				basDeptInfoVO.setSpell(rs.getString("HZSRM1"));//首字母拼音
+				basDeptInfoVO.setStation(rs.getString("FLKSID"));//区域类别
+				
+				BasDeptInfo basDeptInfo=new BasDeptInfo();
+				BeanUtil.copyProperties(basDeptInfoVO, basDeptInfo);
+				
+				basDeptInfoList.add(basDeptInfo);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		return basDeptInfoList;
+	}
+	
 	/**
 	 * 从视图中获取医嘱信息
 	 * @return
@@ -165,7 +233,7 @@ public class DBConn {
 			while(rs.next()){
 				FDoctorAdviceVO doctorAdviceVO=new FDoctorAdviceVO();
 				doctorAdviceVO.setDoctorAdviceId(rs.getString("BRYZID"));//病人医嘱ID
-				doctorAdviceVO.setHospitalId(Long.getLong("1"));//医院ID
+				doctorAdviceVO.setHospitalId(Long.valueOf("1"));//医院ID
 				doctorAdviceVO.setBehospitalCode(rs.getString("BRYZID"));//病人ID
 				doctorAdviceVO.setOrderDoctorName(rs.getString("YSKDPB"));//医生开单判别
 				doctorAdviceVO.setFrequency(rs.getString("YZPLPB"));//医嘱频率判别
@@ -189,6 +257,8 @@ public class DBConn {
 				doctorAdviceVO.setDoctorId(rs.getString("KDYSID"));//开单医生ID
 				doctorAdviceVO.setDoctorName(rs.getString("KDYSXM"));//开单医生姓名
 				
+				//doctorAdviceVO.set
+				
 				DoctorAdvice doctorAdvice=new DoctorAdvice();
 				BeanUtil.copyProperties(doctorAdviceVO, doctorAdvice);
 				
@@ -208,32 +278,33 @@ public class DBConn {
 		List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
 		try {
 			DBConn dbconn=new DBConn();
-			String sql="select * from BR_RECHOME_CX where BAZKRQ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-04-30', 'yyyy-MM-dd')";
+			String sql="select * from BR_INPATIENTINFO_CX where CJCXRQ BETWEEN TO_DATE('2020-01-01', 'yyyy-MM-dd') and TO_DATE('2020-01-20', 'yyyy-MM-dd')";
 			ResultSet rs =dbconn.Query(sql, null);
 			while(rs.next()){
 				FBehospitalInfoVO behospitalInfoVO=new FBehospitalInfoVO();
-				/*
-				behospitalInfoVO.setBehospitalCode(rs.getString("BASYID"));//病人住院ID
-				behospitalInfoVO.setHospitalId(hospitalId);//医院ID
-				behospitalInfoVO.setName(name);//姓名
-				behospitalInfoVO.setSex(sex);//性别
-				behospitalInfoVO.setBirthday(birthday);//出生日期
-				behospitalInfoVO.setFileCode(fileCode);//档案号
-				behospitalInfoVO.setWardCode(wardCode);//病区编码
-				behospitalInfoVO.setWardName(wardName);//病区名称
-				behospitalInfoVO.setBehDeptId(behDeptId);//住院科室ID
-				behospitalInfoVO.setBehDeptName(behDeptName);//住院科室名称
-				behospitalInfoVO.setBedCode(bedCode);//床位号
-				behospitalInfoVO.setBedName(bedName);//床位名称
-				behospitalInfoVO.setInsuranceName(insuranceName);//医保类别
-				behospitalInfoVO.setJobType(jobType);//职业
-				behospitalInfoVO.setBehospitalDate(behospitalDate);//入院时间
-				behospitalInfoVO.setLeaveHospitalDate(leaveHospitalDate);//出院时间
-				behospitalInfoVO.setDiagnoseIcd(diagnoseIcd);//疾病ICD编码
-				behospitalInfoVO.setDiagnose(diagnose);//疾病名称
-				behospitalInfoVO.setDoctorId(doctorId);//医生ID
-				behospitalInfoVO.setDoctorName(doctorName);//医生姓名
-				*/
+				behospitalInfoVO.setBehospitalCode(rs.getString("BRZYID"));//病人住院ID
+				behospitalInfoVO.setHospitalId("1");//医院ID
+				behospitalInfoVO.setName(rs.getString("BRDAXM"));//姓名
+				behospitalInfoVO.setSex(rs.getString("BRDAXB"));//性别
+				behospitalInfoVO.setBirthday(rs.getDate("BRCSRQ"));//出生日期
+				behospitalInfoVO.setFileCode(rs.getString("BRDABH"));//档案号
+				behospitalInfoVO.setWardCode(rs.getString("ZYBQID"));//病区编码
+				behospitalInfoVO.setWardName(rs.getString("ZYBQMC"));//病区名称
+				behospitalInfoVO.setBehDeptId(rs.getString("ZYKSID"));//住院科室ID
+				behospitalInfoVO.setBehDeptName(rs.getString("ZYKSMC"));//住院科室名称
+				behospitalInfoVO.setBedCode(rs.getString("ZYCWID"));//床位号
+				behospitalInfoVO.setBedName(rs.getString("ZYCWHM"));//床位名称
+				behospitalInfoVO.setInsuranceName(rs.getString("BRLBID"));//医保类别
+				behospitalInfoVO.setJobType(rs.getString("BRXZID"));//职业
+				behospitalInfoVO.setBehospitalDate(rs.getDate("BRRYRQ"));//入院时间
+				behospitalInfoVO.setLeaveHospitalDate(rs.getDate("BRCYRQ"));//出院时间
+				behospitalInfoVO.setDiagnoseIcd(rs.getString("JBDMID"));//疾病ICD编码
+				behospitalInfoVO.setDiagnose(rs.getString("JBMSXX"));//疾病名称
+				behospitalInfoVO.setDoctorId(rs.getString("ZZYSID"));//医生ID
+				behospitalInfoVO.setDoctorName(rs.getString("ZZYSXM"));//医生姓名
+				
+				behospitalInfoVO.setGmtCreate(new Date());
+				
 				BehospitalInfo behospitalInfo=new BehospitalInfo();
 				BeanUtil.copyProperties(behospitalInfoVO, behospitalInfo);
 				behospitalInfoList.add(behospitalInfo);
@@ -253,12 +324,12 @@ public class DBConn {
 		List<HomePage> homePageList=Lists.newLinkedList();
 		try {
 			DBConn dbconn=new DBConn();
-			String sql="select * from BR_RECHOME_CX where BAZKRQ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-04-30', 'yyyy-MM-dd')";
+			String sql="select * from BR_RECHOME_CX where BAZKRQ BETWEEN TO_DATE('2020-01-01', 'yyyy-MM-dd') and TO_DATE('2020-01-01', 'yyyy-MM-dd')";
 			ResultSet rs =dbconn.Query(sql, null);
 			while(rs.next()){
 				FHomePageVO homePageVO=new FHomePageVO();
 				homePageVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
-				homePageVO.setHospitalId(Long.getLong(rs.getString("BASYID").toString()));//医院ID
+				homePageVO.setHospitalId(Long.valueOf("1"));//医院ID
 				homePageVO.setBehospitalCode(rs.getString("BRZYID"));//病人住院序号
 				homePageVO.setHospitalCode(rs.getString("ZZJGID"));//组织机构id
 				homePageVO.setHospitalName(rs.getString("ZZJGMC"));//医疗机构名称
@@ -271,6 +342,8 @@ public class DBConn {
 				homePageVO.setSex(rs.getString("BRBAXB"));//性别
 				homePageVO.setBirthday(rs.getDate("BRCSRQ"));//出生日期
 				
+				homePageVO.setGmtCreate(new Date());
+				
 				HomePage homePage=new HomePage();
 				BeanUtil.copyProperties(homePageVO, homePage);
 				homePageList.add(homePage);
@@ -290,18 +363,20 @@ public class DBConn {
 		List<FMedicalRecordVO> medicalRecordVOList=Lists.newLinkedList();
 		try {
 			DBConn dbconn=new DBConn();
-			String sql="select * from MR_MEDICALRECORDS_CX where BAZKRQ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-04-30', 'yyyy-MM-dd')";
+			String sql="select * from MR_MEDICALRECORDS_CX where BCJLSJ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-04-30', 'yyyy-MM-dd')";
 			ResultSet rs =dbconn.Query(sql, null);
 			while(rs.next()){
 				FMedicalRecordVO medicalRecordVO=new FMedicalRecordVO();
 				medicalRecordVO.setRecId(rs.getString("BLCJID"));
-				medicalRecordVO.setHospitalId(Long.getLong("1"));//医院ID
+				medicalRecordVO.setHospitalId(Long.valueOf("1"));//医院ID
 				medicalRecordVO.setBehospitalCode(rs.getString("BRZYID"));//病人住院ID
 				medicalRecordVO.setOrgCode(rs.getString("ZZJGDM"));//组织机构代码
 				medicalRecordVO.setRecTypeId(rs.getString("BLLBID"));//病历类别编号
 				medicalRecordVO.setRecDate(rs.getString("BCJLSJ"));//病历日期
 				medicalRecordVO.setRecTitle(rs.getString("BCJLMC"));//病历标题
 				
+				medicalRecordVO.setGmtCreate(new Date());
+				
 				medicalRecordVOList.add(medicalRecordVO);
 			}
 		} catch (Exception e) {
@@ -320,13 +395,16 @@ public class DBConn {
 		List<FMedicalRecordContentVO> mrContentVOList=Lists.newLinkedList();
 		try {
 			DBConn dbconn=new DBConn();
-			String sql="select * from MR_MEDICALRECORDS_CX where CJCXRQ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-04-30', 'yyyy-MM-dd')";
+			String sql="select * from MR_MRCONTENT_CX where CJCXRQ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-02-20', 'yyyy-MM-dd')";
 			ResultSet rs =dbconn.Query(sql, null);
 			while(rs.next()){
 				FMedicalRecordContentVO mrContentVO=new FMedicalRecordContentVO();
-				mrContentVO.setContentBlob(rs.getBlob("BLJLNR"));
-				mrContentVO.setHospitalId(Long.getLong("1"));
+				//oracle.sql.BLOB blob = (oracle.sql.BLOB)rs.getBlob("BLJLNR");
+				//mrContentVO.setContentBlob(blob);
+				mrContentVO.setHospitalId(Long.valueOf("1"));
 				mrContentVO.setRecId(rs.getString("BLJLID"));
+				
+				mrContentVO.setGmtCreate(new Date());
 				mrContentVOList.add(mrContentVO);
 			}
 		} catch (Exception e) {
@@ -349,7 +427,7 @@ public class DBConn {
 			while(rs.next()){
 				FMedicalRecordTypeVO mrTypeVO=new FMedicalRecordTypeVO();
 				mrTypeVO.setTypeId(rs.getString("BLLBID"));
-				mrTypeVO.setHospitalId(Long.getLong("1"));
+				mrTypeVO.setHospitalId(Long.valueOf("1"));
 				mrTypeVO.setTypeName(rs.getString("BLLBMC"));
 				mrTypeVO.setObjName(rs.getString("BLLBFW"));
 				mrTypeVO.setSpell(rs.getString("HZSRM1"));
@@ -376,7 +454,7 @@ public class DBConn {
 			while(rs.next()){
 				FHomeDiagnoseVO homeDiagnoseVO=new FHomeDiagnoseVO();
 				homeDiagnoseVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
-				homeDiagnoseVO.setHospitalId(Long.getLong("1"));//医院ID
+				homeDiagnoseVO.setHospitalId(Long.valueOf("1"));//医院ID
 				homeDiagnoseVO.setDiagnoseOrderNo(rs.getString("BAZDXH"));//诊断序号
 				homeDiagnoseVO.setDiagnoseType(rs.getString("ZDLBDM"));//诊断类别
 				homeDiagnoseVO.setDiagnoseTypeShort(rs.getString("ZCZDPB"));//诊断判别
@@ -386,6 +464,8 @@ public class DBConn {
 				//homeDiagnoseVO.setPathologyDiagnose(rs.getString("BASYID"));//病理号
 				homeDiagnoseVO.setIcdCode(rs.getString("ICDM"));//诊断编码
 				
+				homeDiagnoseVO.setGmtCreate(new Date());
+				
 				HomeDiagnoseInfo homeDiagnoseInfo=new HomeDiagnoseInfo();
 				BeanUtil.copyProperties(homeDiagnoseVO, homeDiagnoseInfo);
 				homeDiagnoseVOList.add(homeDiagnoseInfo);
@@ -410,7 +490,7 @@ public class DBConn {
 			while(rs.next()){
 				FHomeOperationVO homeOperationVO=new FHomeOperationVO();
 				homeOperationVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
-				homeOperationVO.setHospitalId(Long.getLong("1"));//医院ID
+				homeOperationVO.setHospitalId(Long.valueOf("1"));//医院ID
 				homeOperationVO.setOperationOrderNo(rs.getString("BRSSXH"));//手术序号
 				homeOperationVO.setOperationDate(rs.getDate("BRSSRQ"));//手术日期
 				homeOperationVO.setOperationCode(rs.getString("SSDMID"));//手术编码
@@ -423,6 +503,7 @@ public class DBConn {
 				homeOperationVO.setOperationLevel(rs.getString("SSJBID"));//手术级别
 				homeOperationVO.setAnaesthesiaName(rs.getString("MZFFMC"));//麻醉方式
 				homeOperationVO.setShamOperationName(rs.getString("NSSMC"));//拟手术名称
+				homeOperationVO.setGmtCreate(new Date());
 				
 				homeOperationVOList.add(homeOperationVO);
 			}

+ 600 - 0
src/main/java/com/diagbot/util/TZDBConn.java

@@ -0,0 +1,600 @@
+package com.diagbot.util;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.List;
+import java.util.ResourceBundle;
+
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.entity.BasDoctorInfo;
+import com.diagbot.entity.BehospitalInfo;
+import com.diagbot.entity.DoctorAdvice;
+import com.diagbot.entity.HomeDiagnoseInfo;
+import com.diagbot.entity.HomeOperationInfo;
+import com.diagbot.entity.HomePage;
+import com.diagbot.entity.MedRecordType;
+import com.diagbot.entity.MedicalRecord;
+import com.diagbot.entity.MedicalRecordContent;
+import com.diagbot.vo.FBasDeptInfoVO;
+import com.diagbot.vo.FBasDoctorInfoVO;
+import com.diagbot.vo.FBehospitalInfoVO;
+import com.diagbot.vo.FDoctorAdviceVO;
+import com.diagbot.vo.FHomeDiagnoseVO;
+import com.diagbot.vo.FHomeOperationVO;
+import com.diagbot.vo.FHomePageVO;
+import com.diagbot.vo.FMedicalRecordContentVO;
+import com.diagbot.vo.FMedicalRecordTypeVO;
+import com.diagbot.vo.FMedicalRecordVO;
+import com.google.common.collect.Lists;
+
+public class TZDBConn {
+	private static final String DRIVER = getValue("jdbc.driverClassName");
+    private static final String URL = getValue("jdbc.url");
+    private static final String USERNAME = getValue("jdbc.username");
+    private static final String PASSWORD = getValue("jdbc.password");
+    
+    private static Connection connection = null;
+    private static PreparedStatement sta = null;
+	private static ResultSet rs = null;
+	
+	/**
+     * 读取属性文件中的信息
+     *
+     * @param key
+     * @return
+     */
+    private static String getValue(String key) {
+        // 资源包绑定
+        ResourceBundle bundle = ResourceBundle.getBundle("jdbc");
+        return bundle.getString(key);
+    }
+    
+    /**
+	 * 加载驱动程序
+	 */
+	static {
+		try {
+			Class.forName(DRIVER);
+		} catch (ClassNotFoundException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * @return 连接对象
+	 */
+	public Connection getConnection() {
+		try {
+			connection = DriverManager.getConnection(URL,USERNAME,PASSWORD);
+		} catch (SQLException e) {
+
+			e.printStackTrace();
+		}
+		return connection;
+	}
+	
+	/**
+	 * @param sql sql语句
+	 * @param obj 参数
+	 * @return 数据集合
+	 */
+	public ResultSet Query(String sql,Object...obj){
+		connection=getConnection();
+		try {
+			sta=connection.prepareStatement(sql);
+			if(obj!=null){
+				for(int i=0;i<obj.length;i++){
+					sta.setObject(i+1, obj[i]);
+				}
+			}
+			rs=sta.executeQuery();
+		} catch (SQLException e) {
+			e.printStackTrace();
+		}
+		return rs;
+	}
+	
+	/**
+	 * 关闭资源
+	 */
+	public void close() {
+		try {
+			if (rs != null) {
+				rs.close();
+			}
+		} catch (SQLException e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				if (sta != null) {
+					sta.close();
+				}
+			} catch (SQLException e2) {
+				e2.printStackTrace();
+			} finally {
+				if (connection != null) {
+					try {
+						connection.close();
+					} catch (SQLException e) {
+						e.printStackTrace();
+					}
+				}
+			}
+		}
+	}
+	
+	/**
+	 * 医生信息
+	 * @return
+	 */
+	public static List<BasDoctorInfo> getBasDoctorInfo() {
+		List<BasDoctorInfo> basDoctorInfoList=Lists.newLinkedList();
+		
+		try {
+			TZDBConn dbconn=new TZDBConn();
+			String sql="select * from gi_userinfo where CJCXRQ BETWEEN TO_DATE('2020-03-01', 'yyyy-MM-dd') and TO_DATE('2020-03-30', 'yyyy-MM-dd')";
+			rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				FBasDoctorInfoVO basDoctorInfoVO=new FBasDoctorInfoVO();
+				basDoctorInfoVO.setDoctorId(rs.getString("YHRYBH"));//医生ID
+				basDoctorInfoVO.setHospitalId(Long.valueOf("3"));//医院ID
+				//basDoctorInfoVO.setDeptId(rs.getString("ZZKSID"));//科室ID
+				basDoctorInfoVO.setName(rs.getString("YHRYMC"));//医生姓名
+				basDoctorInfoVO.setProfessor(rs.getString("YHRYZC"));//职称
+				
+				BasDoctorInfo basDoctorInfo=new BasDoctorInfo();
+				BeanUtil.copyProperties(basDoctorInfoVO, basDoctorInfo);
+				
+				basDoctorInfoList.add(basDoctorInfo);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		return basDoctorInfoList;
+	}
+	
+	/**
+	 * 从视图中获取医院科室数据,根据修改时间同步数据
+	 * @return
+	 */
+	public static List<BasDeptInfo> getDeptInfo() {
+		List<BasDeptInfo> basDeptInfoList=Lists.newLinkedList();
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from hi_deptinfo where CJCXRQ BETWEEN TO_DATE('2020-03-01', 'yyyy-MM-dd') and TO_DATE('2020-03-30', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				FBasDeptInfoVO basDeptInfoVO=new FBasDeptInfoVO();
+				basDeptInfoVO.setDeptId(rs.getString("ZZKSDM"));//科室编码
+				basDeptInfoVO.setHospitalId(Long.valueOf("3"));//医院ID
+				basDeptInfoVO.setDeptName(rs.getString("ZZKSMC"));//科室名称
+				//basDeptInfoVO.setDeptType(rs.getString("ZZKSLB"));//科室类别
+				basDeptInfoVO.setSpell(rs.getString("HZSRM1"));//首字母拼音
+				//basDeptInfoVO.setStation(rs.getString("FLKSID"));//区域类别
+				
+				BasDeptInfo basDeptInfo=new BasDeptInfo();
+				BeanUtil.copyProperties(basDeptInfoVO, basDeptInfo);
+				
+				basDeptInfoList.add(basDeptInfo);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return basDeptInfoList;
+	}
+	
+	/**
+	 * 病案诊断
+	 * @return
+	 */
+	public static List<HomeDiagnoseInfo> getHomeDiagnose(){
+		List<HomeDiagnoseInfo> homeDiagnoseVOList=Lists.newLinkedList();
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from br_recdiagnose where CJCXRQ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-04-30', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				FHomeDiagnoseVO homeDiagnoseVO=new FHomeDiagnoseVO();
+				homeDiagnoseVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
+				homeDiagnoseVO.setHospitalId(Long.valueOf("3"));//医院ID
+				homeDiagnoseVO.setDiagnoseOrderNo(rs.getString("BAZDXH"));//诊断序号
+				homeDiagnoseVO.setDiagnoseName(rs.getString("JBDMMC"));//诊断名称
+				homeDiagnoseVO.setDiagnoseType(rs.getString("ZDLBDM"));//诊断类别
+				homeDiagnoseVO.setDiagnoseTypeShort(rs.getString("ZCZDPB"));//诊断判别
+				homeDiagnoseVO.setBehospitalType(rs.getString("RYQKBM"));//入院情况
+				//homeDiagnoseVO.setLeaveHospitalType(rs.getString("RYQKBM"));//出院情况
+				//homeDiagnoseVO.setPathologyDiagnose(rs.getString("BASYID"));//病理号
+				homeDiagnoseVO.setIcdCode(rs.getString("ICDM"));//诊断编码
+				
+				homeDiagnoseVO.setGmtCreate(new Date());
+				
+				HomeDiagnoseInfo homeDiagnoseInfo=new HomeDiagnoseInfo();
+				BeanUtil.copyProperties(homeDiagnoseVO, homeDiagnoseInfo);
+				homeDiagnoseVOList.add(homeDiagnoseInfo);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		return homeDiagnoseVOList;
+	}
+	
+	/**
+	 * 病案手术
+	 * @return
+	 */
+	public static List<HomeOperationInfo> getHomeOperation() {
+		List<FHomeOperationVO> homeOperationVOList=Lists.newLinkedList();
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from br_recoperation where CJCXRQ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-04-30', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				FHomeOperationVO homeOperationVO=new FHomeOperationVO();
+				homeOperationVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
+				homeOperationVO.setHospitalId(Long.valueOf("3"));//医院ID
+				homeOperationVO.setOperationOrderNo(rs.getString("BRSSXH"));//手术序号
+				homeOperationVO.setOperationDate(rs.getDate("BRSSRQ"));//手术日期
+				homeOperationVO.setOperationCode(rs.getString("SSDMID"));//手术编码
+				homeOperationVO.setOperationDoctorId(rs.getString("SSYSID"));//手术医生
+				homeOperationVO.setFirstAssistantId(rs.getString("YZHSID"));//一助医生
+				homeOperationVO.setSecondAssistantId(rs.getString("EZHSID"));//二助医生
+				homeOperationVO.setCutLevel(rs.getString("QKDJDM"));//切口等级
+				homeOperationVO.setHealingLevel(rs.getString("QKDJDM"));//愈合等级
+				homeOperationVO.setOperationName(rs.getString("BRSSMC"));//手术名称
+				homeOperationVO.setOperationLevel(rs.getString("SSJBID"));//手术级别
+				homeOperationVO.setAnaesthesiaName(rs.getString("MZFFMC"));//麻醉方式
+				homeOperationVO.setShamOperationName(rs.getString("NSSMC"));//拟手术名称
+				homeOperationVO.setGmtCreate(new Date());
+				
+				homeOperationVOList.add(homeOperationVO);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		List<HomeOperationInfo> homeOperationList=BeanUtil.listCopyTo(homeOperationVOList, HomeOperationInfo.class);
+		return homeOperationList;
+	}
+	
+	/**
+	 * 从视图获取病案首页信息
+	 */
+	public static List<HomePage> getHomePage() {
+		List<HomePage> homePageList=Lists.newLinkedList();
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from br_rechome where CJCXRQ BETWEEN TO_DATE('2020-01-01', 'yyyy-MM-dd') and TO_DATE('2020-01-01', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				FHomePageVO homePageVO=new FHomePageVO();
+				homePageVO.setHomePageId(rs.getString("BASYID"));//病案首页ID
+				homePageVO.setHospitalId(Long.valueOf("3"));//医院ID
+				homePageVO.setBehospitalCode(rs.getString("BRZYID"));//病人住院序号
+				homePageVO.setHospitalCode(rs.getString("ZZJGID"));//组织机构id
+				homePageVO.setHospitalName(rs.getString("ZZJGMC"));//医疗机构名称
+				homePageVO.setOrgCode(rs.getString("ZZJGBH"));//医疗机构代码
+				homePageVO.setPayType(rs.getString("YLFKLB"));//医疗付费方式
+				homePageVO.setHealthCard(rs.getString("BRJKKH"));//健康卡号
+				homePageVO.setBehospitalNum(rs.getString("BRZYCS"));//住院次数
+				homePageVO.setFileCode(rs.getString("BRBABH"));//病案号
+				homePageVO.setName(rs.getString("BRBAXM"));//姓名
+				homePageVO.setSex(rs.getString("BRBAXB"));//性别
+				homePageVO.setBirthday(rs.getDate("BRCSRQ"));//出生日期
+				homePageVO.setAge(rs.getString("BRDQNL"));//病人年龄
+				homePageVO.setAgeUnit(rs.getString("BRNLDW"));//年龄单位
+				homePageVO.setNationality(rs.getString("BRBAGJ"));//国籍
+				homePageVO.setNewbornMonth(rs.getString("YENLYS"));//新生儿出生月数
+				homePageVO.setNewbornDay(rs.getString("YENLTS"));//新生儿出生天数
+				homePageVO.setNewbornWeight(rs.getString("YECSTZ"));//新生儿出生体重
+				homePageVO.setNewbornBehospitalWeight(rs.getString("YERYTZ"));//新生儿入院体重
+				homePageVO.setBornAddress(rs.getString("BRCSDZ"));//出生地
+				homePageVO.setBornPlace(rs.getString("BRBAJG"));//籍贯
+				homePageVO.setNation(rs.getString("BRBAMZ"));//民族
+				homePageVO.setIdentityCardNo(rs.getString("BRSFZH"));//身份证号
+				homePageVO.setJobType(rs.getString("BRBASF"));//职业
+				homePageVO.setMarriage(rs.getString("BRHYZK"));//婚姻
+				homePageVO.setCurAddress(rs.getString("BRLXDZ"));//现住址
+				homePageVO.setCurPhone(rs.getString("BRLXDH"));//现住址电话
+				homePageVO.setCurPostCode(rs.getString("LXDZYB"));//现住址邮编
+				homePageVO.setResidenceAddress(rs.getString("BRHKDZ"));//户口地址
+				homePageVO.setResidencePostCode(rs.getString("HKDZYB"));//户口地址邮编
+				homePageVO.setWorkAddress(rs.getString("GZDWMC"));//工作单位
+				homePageVO.setWorkPhone(rs.getString("GZDWDH"));//工作单位电话
+				homePageVO.setWorkPostCode(rs.getString("GZDWYB"));//工作单位邮编
+				homePageVO.setContactName(rs.getString("LXRYXM"));//联系人姓名
+				homePageVO.setContactRelation(rs.getString("LXRYGX"));//联系人关系
+				homePageVO.setContactAddress(rs.getString("LXRYDZ"));//联系人地址
+				homePageVO.setContactPhone(rs.getString("LXRYDH"));//联系人电话
+				homePageVO.setBehospitalWay(rs.getString("RYLYDM"));//入院途径
+				homePageVO.setBehospitalDate(rs.getDate("BRRYRQ"));//入院时间
+				homePageVO.setBehospitalDept(rs.getString("RYKSID"));//入院科室
+				homePageVO.setBehospitalWard(rs.getString("RYBQID"));//入院病房
+				homePageVO.setBehospitalBedId(rs.getString("RYCWID"));//入院床位序号
+				homePageVO.setBehospitalBedCode(rs.getString("RYCWHM"));//入院床位号码
+				homePageVO.setChangeDept(rs.getString("BRZKKB"));//转科科别
+				homePageVO.setLeaveHospitalDate(rs.getDate("BRCYRQ"));//出院时间
+				homePageVO.setLeaveHospitalDept(rs.getString("CYKSID"));//出院科别
+				homePageVO.setLeaveHospitalWard(rs.getString("CYBQID"));//出院病房
+				homePageVO.setLeaveHospitalBedId(rs.getString("CYCWID"));//出院床位序号
+				homePageVO.setLeaveHospitalBedCode(rs.getString("CYCWHM"));//出院床位号码
+				homePageVO.setBehospitalDayNum(rs.getString("SJZYTS"));//实际住院天数
+				homePageVO.setOutpatientEmrDiagnose(rs.getString("BRMZZD"));//门急诊诊断
+				homePageVO.setOutpatientEmrDiagnoseCode(rs.getString("MZZDDM"));//门急诊诊断编码
+				homePageVO.setPoisonFactor(rs.getString("SSZDYSMC"));//损伤中毒因素
+				homePageVO.setPoisonFactorCode(rs.getString("SSZDYSBM"));//损伤中毒因素编码
+				homePageVO.setPathologyDiagnose(rs.getString("BLZDMC"));//病理诊断
+				homePageVO.setPathologyDiagnoseCode(rs.getString("BLZDBM"));//病理诊断编码
+				homePageVO.setPathologyDiagnoseId(rs.getString("BLZDBH"));//病理诊断编号
+				homePageVO.setIsMedAllergy(rs.getString("YWYWGM"));//药物过敏
+				homePageVO.setMedAllergyName(rs.getString("BRGMYW"));//过敏药物
+				homePageVO.setAutopsy(rs.getString("BRSFSJ"));//死亡患者尸检
+				homePageVO.setBloodType(rs.getString("BRBAXX"));//血型
+				homePageVO.setRh(rs.getString("BRBARH"));//Rh
+				homePageVO.setDeptDirector(rs.getString("KZR"));//科主任
+				homePageVO.setDirectorDoctor(rs.getString("ZRYS"));//主任医师
+				homePageVO.setAttendingDoctor(rs.getString("ZZYS"));//主治医师
+				homePageVO.setBehospitalDoctor(rs.getString("ZYYS"));//住院医师
+				homePageVO.setResponseNurse(rs.getString("ZRHS"));//责任护士
+				homePageVO.setStudyDoctor(rs.getString("JXYS"));//进修医师
+				homePageVO.setPracticeDoctor(rs.getString("SXYS"));//实习医师
+				homePageVO.setEncodeMan(rs.getString("BMY"));//编码员
+				homePageVO.setHomePageQuality(rs.getString("BRBAZL"));//病案质量
+				homePageVO.setQcDoctor(rs.getString("BAZKYS"));//质控医师
+				homePageVO.setQcNurse(rs.getString("BAZKHS"));//质控护士
+				homePageVO.setQcDate(rs.getDate("BAZKRQ"));//质控日期
+				homePageVO.setLeaveHospitalType(rs.getString("BRLYFS"));//离院方式
+				homePageVO.setAcceptOrgCode(rs.getString("ZYJGMC"));//接收机构名称
+				homePageVO.setAgainBehospitalPlan(rs.getString("SSYZZY"));//31天内再住院计划
+				homePageVO.setAgainBehospitalGoal(rs.getString("SSYZZYMD"));//再住院目的
+				homePageVO.setTbiBeforeDay(rs.getString("RYQHMTS"));//颅脑损伤患者昏迷前天数
+				homePageVO.setTbiBeforeHour(rs.getString("RYQHMXS"));//颅脑损伤患者昏迷前小时
+				homePageVO.setTbiBeforeMinute(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷前分钟
+				homePageVO.setTbiAfterDay(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷后天数
+				homePageVO.setTbiAfterHour(rs.getString("RYHHMXS"));//颅脑损伤患者昏迷后小时
+				homePageVO.setTbiAfterMinute(rs.getString("RYQHMFZ"));//颅脑损伤患者昏迷后分钟
+				homePageVO.setTotalFee(rs.getString("ZFY"));//总费用
+				homePageVO.setOwnFee(rs.getString("ZFJE"));//自付金额
+				homePageVO.setGeneralFee(rs.getString("YBYLFWF"));//一般医疗服务费
+				homePageVO.setServiceFee(rs.getString("YBZLCZF"));//一般治疗服务费
+				homePageVO.setNurseFee(rs.getString("HLF"));//护理费
+				homePageVO.setOtherFee(rs.getString("QTFY"));//其他费用
+				homePageVO.setPathologyFee(rs.getString("BLZDF"));//病理诊断费
+				homePageVO.setLabFee(rs.getString("SYSZDF"));//实验室诊断费
+				homePageVO.setPacsFee(rs.getString("YXXZDF"));//影像学诊断费
+				homePageVO.setClinicDiagnoseFee(rs.getString("LCZDXMF"));//临床诊断项目费
+				homePageVO.setNotOperationFee(rs.getString("FSSZLXMF"));//非手术治疗项目费
+				homePageVO.setClinicPhysicFee(rs.getString("LCWLZLF"));//临床物理治疗费
+				homePageVO.setOperationTreatFee(rs.getString("SSZLF"));//手术治疗费
+				homePageVO.setAnaesthesiaFee(rs.getString("MZF"));//麻醉费
+				homePageVO.setOperationFee(rs.getString("SSF"));//手术费
+				homePageVO.setHealthTypeFee(rs.getString("KFF"));//康复类
+				homePageVO.setChnTreatFee(rs.getString("ZYZLF"));//中医治疗费
+				homePageVO.setWesternMedFee(rs.getString("XYF"));//西药费
+				homePageVO.setAntibiosisFee(rs.getString("KJYWF"));//抗菌药物费用
+				homePageVO.setChnMedFee(rs.getString("ZCYF"));//中成药费
+				homePageVO.setChnHerbFee(rs.getString("CYF"));//中草药费
+				homePageVO.setBloodFee(rs.getString("XF"));//血费
+				homePageVO.setAlbumenFee(rs.getString("BDBLZPF"));//白蛋白类制品费
+				homePageVO.setGlobulinFee(rs.getString("QDBLZPF"));//球蛋白类制品费
+				homePageVO.setBloodFactorFee(rs.getString("NXYZLZPF"));//凝血因子类制品费
+				homePageVO.setCellFactorFee(rs.getString("XBYZLZPF"));//细胞因子类制品费
+				homePageVO.setCheckMaterialFee(rs.getString("JCYYCXYYCLF"));//检查用一次性医用材料费
+				homePageVO.setTreatMaterialFee(rs.getString("ZLYYCXYYCLF"));//治疗用一次性医用材料费
+				homePageVO.setOperationMaterialFee(rs.getString("SSYYCXYYCLF"));//手术用一次性医用材料费
+				homePageVO.setOtherTypeFee(rs.getString("QTF"));//其他类其他费
+				homePageVO.setSingleDiagManage(rs.getString("DBZGL"));//单病种管理
+				homePageVO.setClinicPathwayManage(rs.getString("SSLCLJGL"));//临床路径管理
+				homePageVO.setIsOutpatientBehospital(rs.getString("MZZYFH"));//门诊与住院
+				homePageVO.setIsLeaveBehospital(rs.getString("RYCYFH"));//入院与出院
+				homePageVO.setIsOperationBeforeAfter(rs.getString("SQSHFH"));//术前与术后
+				homePageVO.setIsClinicPathology(rs.getString("LCBLFH"));//临床与病理
+				homePageVO.setIsRadiatePathology(rs.getString("FSBLFH"));//放射与病理
+				homePageVO.setRescueSuccessNum(rs.getString("BRQJCS"));//病人抢救次数
+				homePageVO.setRescueSuccessNum(rs.getString("QJCGCS"));//病人抢救成功次数
+				homePageVO.setIsAutoLeavehospital(rs.getString("ZDCYPB"));//是否为自动出院
+				homePageVO.setReturnToType(rs.getString("CYQKDM"));//转归情况
+				
+				homePageVO.setGmtCreate(new Date());
+				
+				HomePage homePage=new HomePage();
+				BeanUtil.copyProperties(homePageVO, homePage);
+				homePageList.add(homePage);
+				
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return homePageList;
+	}
+	
+	/**
+	 * 获取病历信息
+	 * @return
+	 */
+	public static List<BehospitalInfo> getBehospitalInfo() {
+		List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from br_inpatientinfo where CJCXRQ BETWEEN TO_DATE('2020-01-01', 'yyyy-MM-dd') and TO_DATE('2020-01-20', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				FBehospitalInfoVO behospitalInfoVO=new FBehospitalInfoVO();
+				behospitalInfoVO.setBehospitalCode(rs.getString("BRZYID"));//病人住院ID
+				behospitalInfoVO.setHospitalId("3");//医院ID
+				behospitalInfoVO.setName(rs.getString("BRDAXM"));//姓名
+				behospitalInfoVO.setSex(rs.getString("BRDAXB"));//性别
+				behospitalInfoVO.setBirthday(rs.getDate("BRCSRQ"));//出生日期
+				behospitalInfoVO.setFileCode(rs.getString("BRDABH"));//档案号
+				behospitalInfoVO.setWardCode(rs.getString("ZYBQID"));//病区编码
+				behospitalInfoVO.setWardName(rs.getString("ZYBQMC"));//病区名称
+				behospitalInfoVO.setBehDeptId(rs.getString("ZYKSID"));//住院科室ID
+				behospitalInfoVO.setBehDeptName(rs.getString("ZYKSMC"));//住院科室名称
+				behospitalInfoVO.setBedCode(rs.getString("ZYCWID"));//床位号
+				behospitalInfoVO.setBedName(rs.getString("ZYCWHM"));//床位名称
+				behospitalInfoVO.setInsuranceName(rs.getString("BRLBID"));//医保类别
+				behospitalInfoVO.setJobType(rs.getString("BRXZID"));//职业
+				behospitalInfoVO.setBehospitalDate(rs.getDate("BRRYRQ"));//入院时间
+				behospitalInfoVO.setLeaveHospitalDate(rs.getDate("BRCYRQ"));//出院时间
+				behospitalInfoVO.setDiagnoseIcd(rs.getString("JBDMID"));//疾病ICD编码
+				behospitalInfoVO.setDiagnose(rs.getString("JBMSXX"));//疾病名称
+				behospitalInfoVO.setDoctorId(rs.getString("ZZYSID"));//医生ID
+				behospitalInfoVO.setDoctorName(rs.getString("ZZYSXM"));//医生姓名
+				
+				behospitalInfoVO.setGmtCreate(new Date());
+				
+				BehospitalInfo behospitalInfo=new BehospitalInfo();
+				BeanUtil.copyProperties(behospitalInfoVO, behospitalInfo);
+				behospitalInfoList.add(behospitalInfo);
+				
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		return behospitalInfoList;
+	}
+	
+	/**
+	 * 从视图中获取医嘱信息
+	 * @return
+	 */
+	public static List<DoctorAdvice> getDoctorAdvice(){
+		List<DoctorAdvice> doctorAdviceList=Lists.newLinkedList();
+		
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from br_doctadvice where CJCXRQ BETWEEN TO_DATE('2020-03-01', 'yyyy-MM-dd') and TO_DATE('2020-03-30', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				FDoctorAdviceVO doctorAdviceVO=new FDoctorAdviceVO();
+				doctorAdviceVO.setDoctorAdviceId(rs.getString("BRYZID"));//病人医嘱ID
+				doctorAdviceVO.setHospitalId(Long.valueOf("3"));//医院ID
+				doctorAdviceVO.setBehospitalCode(rs.getString("BRZYID"));//病人ID
+				doctorAdviceVO.setOrderDoctorName(rs.getString("YSKDPB"));//医生开单判别
+				doctorAdviceVO.setFrequency(rs.getString("YZPLPB"));//医嘱频率判别
+				doctorAdviceVO.setParentTypeId(rs.getString("FLYZID"));//父类医嘱ID
+				doctorAdviceVO.setDoctorAdviceType(rs.getString("YZLXPB"));//医嘱类型判别
+				doctorAdviceVO.setUsageNum(rs.getString("YCSYSL"));//一次使用数量
+				doctorAdviceVO.setUsageUnit(rs.getString("YCYLDW"));//一次用量单位
+				doctorAdviceVO.setDose(rs.getString("YZDCJL"));//医嘱单次剂量
+				doctorAdviceVO.setDoseUnit(rs.getString("DCJLDW"));//单次剂量单位
+				doctorAdviceVO.setMedModeType(rs.getString("GYFSID"));//给药方式
+				doctorAdviceVO.setDaFrequency(rs.getString("YZPLID"));//医嘱频率
+				doctorAdviceVO.setDaDealType(rs.getString("YZCLLX"));//医嘱处理类型
+				doctorAdviceVO.setDaStartDate(rs.getDate("YZKSSJ"));//医嘱开始时间
+				doctorAdviceVO.setDaItemName(rs.getString("YZXMMC"));//医嘱项目名称
+				doctorAdviceVO.setDaStatus(rs.getString("YZZTPB"));//医嘱状态判别
+				doctorAdviceVO.setDaStopDate(rs.getDate("YZJSSJ"));//医嘱结束时间
+				doctorAdviceVO.setDaGroupNo(rs.getString("YZTZXH"));//医嘱同组序号
+				doctorAdviceVO.setDaPrescriptionType(rs.getString("YZCFLX"));//医嘱处方类型
+				doctorAdviceVO.setDaMedType(rs.getString("YZLYLX"));//医嘱领药类型
+				doctorAdviceVO.setDoctorNotice(rs.getString("YSZTSM"));//医生嘱托
+				doctorAdviceVO.setDoctorId(rs.getString("KDYSID"));//开单医生ID
+				doctorAdviceVO.setDoctorName(rs.getString("KDYSXM"));//开单医生姓名
+				
+				//doctorAdviceVO.set
+				
+				DoctorAdvice doctorAdvice=new DoctorAdvice();
+				BeanUtil.copyProperties(doctorAdviceVO, doctorAdvice);
+				
+				doctorAdviceList.add(doctorAdvice);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return doctorAdviceList;
+	}
+
+	/**
+	 * 从视图中获取文书类型
+	 * @return
+	 */
+	public static List<MedicalRecord> getMedicalRecord(){
+		List<FMedicalRecordVO> medicalRecordVOList=Lists.newLinkedList();
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from ar_medirecclass where CJCXRQ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-04-30', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				FMedicalRecordVO medicalRecordVO=new FMedicalRecordVO();
+				medicalRecordVO.setRecId(rs.getString("BLCJID"));
+				medicalRecordVO.setHospitalId(Long.valueOf("3"));//医院ID
+				medicalRecordVO.setBehospitalCode(rs.getString("BRZYID"));//病人住院ID
+				medicalRecordVO.setOrgCode(rs.getString("ZZJGDM"));//组织机构代码
+				medicalRecordVO.setRecTypeId(rs.getString("BLLBID"));//病历类别编号
+				medicalRecordVO.setRecDate(rs.getString("BCJLSJ"));//病历日期
+				medicalRecordVO.setRecTitle(rs.getString("BLJLMC"));//病历标题
+				
+				medicalRecordVO.setGmtCreate(new Date());
+				
+				medicalRecordVOList.add(medicalRecordVO);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		List<MedicalRecord> medicalRecordList=BeanUtil.listCopyTo(medicalRecordVOList, MedicalRecord.class);
+		return medicalRecordList;
+	}
+	
+	/**
+	 * 从视图中获取文书内容
+	 * @return
+	 */
+	public static List<MedicalRecordContent> getMedicalRecordContent(){
+		List<FMedicalRecordContentVO> mrContentVOList=Lists.newLinkedList();
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from mr_mrcontent where CJCXRQ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-02-20', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				FMedicalRecordContentVO mrContentVO=new FMedicalRecordContentVO();
+				//oracle.sql.BLOB blob = (oracle.sql.BLOB)rs.getBlob("BLJLNR");
+				//mrContentVO.setContentBlob(blob);
+				mrContentVO.setHospitalId(Long.valueOf("3"));
+				mrContentVO.setRecId(rs.getString("BLJLID"));
+				
+				mrContentVO.setGmtCreate(new Date());
+				mrContentVOList.add(mrContentVO);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		List<MedicalRecordContent> mrContentList=BeanUtil.listCopyTo(mrContentVOList, MedicalRecordContent.class);
+		return mrContentList;
+	}
+	
+	/**
+	 * 从视图中获取文书类型
+	 * @return
+	 */
+	public static List<MedRecordType> getMedicalRecordType(){
+		List<FMedicalRecordTypeVO> mrTypeVOList=Lists.newLinkedList();
+		try {
+			DBConn dbconn=new DBConn();
+			String sql="select * from ar_medirecclass where CJCXRQ BETWEEN TO_DATE('2020-02-01', 'yyyy-MM-dd') and TO_DATE('2020-02-20', 'yyyy-MM-dd')";
+			ResultSet rs =dbconn.Query(sql, null);
+			while(rs.next()){
+				FMedicalRecordTypeVO mrTypeVO=new FMedicalRecordTypeVO();
+				mrTypeVO.setTypeId(rs.getString("BLLBID"));
+				mrTypeVO.setHospitalId(Long.valueOf("3"));
+				mrTypeVO.setTypeName(rs.getString("BLLBMC"));
+				mrTypeVO.setParentTypeId(rs.getString("SJLBID"));
+				mrTypeVO.setObjName(rs.getString("BLLBFW"));
+				mrTypeVO.setSpell(rs.getString("HZSRM1"));
+				mrTypeVOList.add(mrTypeVO);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		List<MedRecordType> medicalRecordTypeList=BeanUtil.listCopyTo(mrTypeVOList, MedRecordType.class);
+		return medicalRecordTypeList;
+	}
+	
+}

+ 43 - 0
src/main/java/com/diagbot/vo/FBasDeptInfoVO.java

@@ -0,0 +1,43 @@
+package com.diagbot.vo;
+
+import java.time.LocalDateTime;
+
+import lombok.Data;
+
+@Data
+public class FBasDeptInfoVO {
+	/**
+     * 科室编码(HIS导入)
+     */
+    private String deptId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 科室名称
+     */
+    private String deptName;
+
+    /**
+     * 科室类别
+     */
+    private String deptType;
+
+    /**
+     * 首字母拼音
+     */
+    private String spell;
+
+    /**
+     * 区域类别(门诊、工作站、住院等)
+     */
+    private String station;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+}

+ 38 - 0
src/main/java/com/diagbot/vo/FBasDoctorInfoVO.java

@@ -0,0 +1,38 @@
+package com.diagbot.vo;
+
+import java.time.LocalDateTime;
+
+import lombok.Data;
+
+@Data
+public class FBasDoctorInfoVO {
+	/**
+     * HIS导入的医生ID
+     */
+    private String doctorId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院导入科室ID
+     */
+    private String deptId;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 职称
+     */
+    private String professor;
+
+    /**
+     * 记录创建时间
+     */
+    private LocalDateTime gmtCreate;
+}

+ 5 - 0
src/main/java/com/diagbot/vo/FBehospitalInfoVO.java

@@ -106,4 +106,9 @@ public class FBehospitalInfoVO{
      * 医生姓名
      */
     private String doctorName;
+    
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
 }

+ 7 - 0
src/main/java/com/diagbot/vo/FHomeDiagnoseVO.java

@@ -1,5 +1,7 @@
 package com.diagbot.vo;
 
+import java.util.Date;
+
 import lombok.Data;
 
 @Data
@@ -38,4 +40,9 @@ public class FHomeDiagnoseVO {
     private String pathologyDiagnose;
 
     private String icdCode;
+    
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
 }

+ 5 - 0
src/main/java/com/diagbot/vo/FHomeOperationVO.java

@@ -75,4 +75,9 @@ public class FHomeOperationVO {
      * 拟手术名称
      */
     private String shamOperationName;
+    
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
 }

+ 6 - 0
src/main/java/com/diagbot/vo/FMedicalRecordContentVO.java

@@ -1,6 +1,7 @@
 package com.diagbot.vo;
 
 import java.sql.Blob;
+import java.util.Date;
 
 import lombok.Data;
 
@@ -25,4 +26,9 @@ public class FMedicalRecordContentVO {
      * 病历文本(文本)
      */
     private String contentText;
+    
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
 }

+ 7 - 0
src/main/java/com/diagbot/vo/FMedicalRecordVO.java

@@ -1,5 +1,7 @@
 package com.diagbot.vo;
 
+import java.util.Date;
+
 import lombok.Data;
 
 @Data
@@ -35,4 +37,9 @@ public class FMedicalRecordVO {
      * 病历标题
      */
     private String recTitle;
+    
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
 }

+ 75 - 5
src/main/java/com/diagbot/web/DataController.java

@@ -1,13 +1,31 @@
 package com.diagbot.web;
 
+import java.util.List;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.FBehospitalInfoDTO;
+import com.diagbot.dto.FDoctorAdviceDTO;
+import com.diagbot.dto.FHomeDiagnoseDTO;
+import com.diagbot.dto.FHomePageDTO;
+import com.diagbot.dto.FMedicalRecordContentDTO;
+import com.diagbot.dto.FMedicalRecordDTO;
+import com.diagbot.dto.FMedicalRecordTypeDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.BehospitalInfo;
+import com.diagbot.entity.DoctorAdvice;
+import com.diagbot.entity.HomeDiagnoseInfo;
+import com.diagbot.entity.HomeOperationInfo;
+import com.diagbot.entity.HomePage;
+import com.diagbot.entity.MedRecordType;
+import com.diagbot.entity.MedicalRecord;
+import com.diagbot.entity.MedicalRecordContent;
 import com.diagbot.facade.DataFacade;
+import com.diagbot.util.BeanUtil;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -25,21 +43,73 @@ public class DataController {
 	@PostMapping("/initData")
 	@SysLogger("initData")
 	public RespDTO<Boolean> initData() {
-		return RespDTO.onSuc(dataFacade.initData());
+		//return RespDTO.onSuc(dataFacade.initData());
+		return null;
 	}
 	
 	@ApiOperation(value = "获取医院病案首页信息[by:gaodm]",notes = "")
 	@PostMapping("/getHomePage")
 	@SysLogger("getHomePage")
-	public RespDTO<Boolean> getHomePage() {
-		return RespDTO.onSuc(dataFacade.addHomePage());
+	public RespDTO<Boolean> getHomePage(List<FHomePageDTO> homePageDTOList) {
+		List<HomePage> homePageList=BeanUtil.listCopyTo(homePageDTOList, HomePage.class);
+		return RespDTO.onSuc(dataFacade.addHomePage(homePageList));
+	}
+	
+	@ApiOperation(value = "获取病案手术信息[by:gaodm]",notes = "")
+	@PostMapping("/getHomeOperation")
+	@SysLogger("getHomeOperation")
+	public RespDTO<Boolean> getHomeOperation(List<FHomeDiagnoseDTO> homeOperationDTO) {
+		List<HomeOperationInfo> homeOperationList=BeanUtil.listCopyTo(homeOperationDTO, HomeOperationInfo.class);
+		return RespDTO.onSuc(dataFacade.addHomeOperation(homeOperationList));
+	}
+	
+	@ApiOperation(value = "获取病案诊断信息[by:gaodm]",notes = "")
+	@PostMapping("/getHomeDiagnose")
+	@SysLogger("getHomeDiagnose")
+	public RespDTO<Boolean> getHomeDiagnose(List<FHomeDiagnoseDTO> homeDiagnoseDTOList) {
+		List<HomeDiagnoseInfo> homeDiagnoseList=BeanUtil.listCopyTo(homeDiagnoseDTOList, HomeDiagnoseInfo.class);
+		return RespDTO.onSuc(dataFacade.addHomeDiagnose(homeDiagnoseList));
+	}
+	
+	@ApiOperation(value = "获取文书类型信息[by:]",notes = "")
+	@PostMapping("/getMedicalRecordType")
+	@SysLogger("getMedicalRecordType")
+	public RespDTO<Boolean> getMedicalRecordType(List<FMedicalRecordTypeDTO> medlRecordTypeDTOList) {
+		List<MedRecordType> medlRecordTypeList=BeanUtil.listCopyTo(medlRecordTypeDTOList, MedRecordType.class);
+		return RespDTO.onSuc(dataFacade.addMedicalRecordType(medlRecordTypeList));
+	}
+	
+	
+	@ApiOperation(value = "获取文书内容信息[by:gaodm]",notes = "")
+	@PostMapping("/getMedicalRecordContent")
+	@SysLogger("getMedicalRecordContent")
+	public RespDTO<Boolean> getMedicalRecordContent(List<FMedicalRecordContentDTO> medlRecordContentDTOList) {
+		List<MedicalRecordContent> medicalRecordContentList=BeanUtil.listCopyTo(medlRecordContentDTOList, MedicalRecordContent.class);
+		return RespDTO.onSuc(dataFacade.addMedicalRecordContent(medicalRecordContentList));
+	}
+
+	@ApiOperation(value = "获取文书基本信息[by:gaodm]",notes = "")
+	@PostMapping("/getMedicalRecord")
+	@SysLogger("getMedicalRecord")
+	public RespDTO<Boolean> getMedicalRecord(List<FMedicalRecordDTO> medicalRecordDTOList) {
+		List<MedicalRecord> medicalRecordList=BeanUtil.listCopyTo(medicalRecordDTOList, MedicalRecord.class);
+		return RespDTO.onSuc(dataFacade.addMedicalRecord(medicalRecordList));
 	}
 	
 	@ApiOperation(value = "获取医院医嘱信息[by:gaodm]",notes = "")
 	@PostMapping("/getDoctorAdvice")
 	@SysLogger("getDoctorAdvice")
-	public RespDTO<Boolean> getDoctorAdvice() {
-		return RespDTO.onSuc(dataFacade.addDoctorAdvice());
+	public RespDTO<Boolean> getDoctorAdvice(List<FDoctorAdviceDTO> doctorAdviceDTOList) {
+		List<DoctorAdvice> doctorAdviceList=BeanUtil.listCopyTo(doctorAdviceDTOList, DoctorAdvice.class);
+		return RespDTO.onSuc(dataFacade.addDoctorAdvice(doctorAdviceList));
+	}
+	
+	@ApiOperation(value = "获取病历信息[by:gaodm]",notes = "")
+	@PostMapping("/getBehospitalInfo")
+	@SysLogger("getBehospitalInfo")
+	public RespDTO<Boolean> getBehospitalInfo(List<FBehospitalInfoDTO> behospitalInfoDTOList) {
+		List<BehospitalInfo> behospitalInfoList=BeanUtil.listCopyTo(behospitalInfoDTOList, BehospitalInfo.class);
+		return RespDTO.onSuc(dataFacade.addBehospitalInfo(behospitalInfoList));
 	}
 	
 }

+ 1 - 1
src/main/resources/application-local.yml

@@ -58,7 +58,7 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.236:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://192.168.2.236:3306/qc_qq?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
       password: lantone
       # 连接池的配置信息

+ 20 - 0
src/main/resources/mapper/BasDeptInfoMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.BasDeptInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.BasDeptInfo">
+        <id column="dept_id" property="deptId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="dept_name" property="deptName" />
+        <result column="dept_type" property="deptType" />
+        <result column="spell" property="spell" />
+        <result column="station" property="station" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+    </resultMap>
+
+</mapper>

+ 19 - 0
src/main/resources/mapper/BasDoctorInfoMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.BasDoctorInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.BasDoctorInfo">
+        <id column="doctor_id" property="doctorId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="dept_id" property="deptId" />
+        <result column="name" property="name" />
+        <result column="professor" property="professor" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+    </resultMap>
+
+</mapper>

+ 1 - 1
src/test/java/com/diagbot/CodeGeneration.java

@@ -56,7 +56,7 @@ public class CodeGeneration {
         StrategyConfig strategy = new StrategyConfig();
 //        strategy.setTablePrefix(new String[] { "med_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "sys_task_cron"}); // 需要生成的表
+        strategy.setInclude(new String[] { "bas_doctor_info","bas_dept_info"}); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);