CX 7 månader sedan
förälder
incheckning
551c5bad1c
28 ändrade filer med 555 tillägg och 1884 borttagningar
  1. 0 18
      src/main/java/com/dashitech/businessdata/dao/IDrugsBagDAO.java
  2. 0 15
      src/main/java/com/dashitech/businessdata/dao/IDrugsDAO.java
  3. 0 38
      src/main/java/com/dashitech/businessdata/dao/IInspectDAO.java
  4. 0 18
      src/main/java/com/dashitech/businessdata/dao/IJPBagDAO.java
  5. 0 12
      src/main/java/com/dashitech/businessdata/dao/IJPDetailsDAO.java
  6. 0 33
      src/main/java/com/dashitech/businessdata/dao/IPatientDAO.java
  7. 0 20
      src/main/java/com/dashitech/businessdata/dao/IPatientLogDAO.java
  8. 0 41
      src/main/java/com/dashitech/businessdata/dao/ISpecimenDAO.java
  9. 0 22
      src/main/java/com/dashitech/businessdata/dao/ISpecimenHistoryDAO.java
  10. 0 20
      src/main/java/com/dashitech/businessdata/dao/IWorkOrderDAO.java
  11. 0 145
      src/main/java/com/dashitech/businessdata/entity/DrugsBagEntity.java
  12. 0 137
      src/main/java/com/dashitech/businessdata/entity/DrugsEntity.java
  13. 0 270
      src/main/java/com/dashitech/businessdata/entity/InspectEntity.java
  14. 0 120
      src/main/java/com/dashitech/businessdata/entity/JPBagEntity.java
  15. 0 114
      src/main/java/com/dashitech/businessdata/entity/JPDetailsEntity.java
  16. 0 236
      src/main/java/com/dashitech/businessdata/entity/PatientEntity.java
  17. 0 125
      src/main/java/com/dashitech/businessdata/entity/PatientLogEntity.java
  18. 0 291
      src/main/java/com/dashitech/businessdata/entity/SpecimenEntity.java
  19. 0 91
      src/main/java/com/dashitech/businessdata/entity/SpecimenHistoryEntity.java
  20. 0 88
      src/main/java/com/dashitech/businessdata/entity/WorkOrderEntity.java
  21. 51 0
      src/main/java/com/dashitech/callcenter/init/TestInit.java
  22. 113 21
      src/main/java/com/dashitech/callcenter/socket/HandlerThread.java
  23. 11 0
      src/main/java/com/dashitech/config/DataSourceConfig.java
  24. 111 0
      src/main/java/com/dashitech/config/datasource/MySQL1DataSourceConfig.java
  25. 21 0
      src/main/java/com/dashitech/hsms/dao/IHsmsCallLogDAO.java
  26. 174 0
      src/main/java/com/dashitech/hsms/entity/HsmsCallLogEntity.java
  27. 38 9
      src/main/resources/application.properties
  28. 36 0
      src/main/resources/readme

+ 0 - 18
src/main/java/com/dashitech/businessdata/dao/IDrugsBagDAO.java

@@ -1,18 +0,0 @@
1
-package com.dashitech.businessdata.dao;
2
-
3
-import com.dashitech.businessdata.entity.DrugsBagEntity;
4
-import org.springframework.data.jpa.repository.JpaRepository;
5
-import org.springframework.data.jpa.repository.Query;
6
-import org.springframework.data.repository.query.Param;
7
-
8
-/**
9
- * Created by chi on 2019/9/12.
10
- */
11
-public interface IDrugsBagDAO  extends JpaRepository<DrugsBagEntity, String> {
12
-
13
-    @SuppressWarnings("unchecked")
14
-    DrugsBagEntity save(DrugsBagEntity drugsBagEntity);
15
-
16
-    @Query(value = "select id from DrugsBagEntity where packid=:packid")
17
-    Long selectIdByPackid(@Param("packid")String packid);
18
-}

+ 0 - 15
src/main/java/com/dashitech/businessdata/dao/IDrugsDAO.java

@@ -1,15 +0,0 @@
1
-package com.dashitech.businessdata.dao;
2
-
3
-import com.dashitech.businessdata.entity.DrugsEntity;
4
-import org.springframework.data.jpa.repository.JpaRepository;
5
-
6
-/**
7
- * Created by chi on 2019/9/10.
8
- */
9
-public interface IDrugsDAO extends JpaRepository<DrugsEntity, String> {
10
-
11
-    @SuppressWarnings("unchecked")
12
-    DrugsEntity save(DrugsEntity drugsEntity);
13
-
14
-
15
-}

+ 0 - 38
src/main/java/com/dashitech/businessdata/dao/IInspectDAO.java

@@ -1,38 +0,0 @@
1
-package com.dashitech.businessdata.dao;
2
-
3
-import com.dashitech.businessdata.entity.InspectEntity;
4
-import org.springframework.data.jpa.repository.JpaRepository;
5
-import org.springframework.data.jpa.repository.Modifying;
6
-import org.springframework.data.jpa.repository.Query;
7
-import org.springframework.data.repository.query.Param;
8
-import org.springframework.transaction.annotation.Transactional;
9
-
10
-import java.util.List;
11
-
12
-/**
13
- * Created by chi on 2019/9/12.
14
- */
15
-public interface IInspectDAO  extends JpaRepository<InspectEntity, String> {
16
-
17
-    @SuppressWarnings("unchecked")
18
-    InspectEntity save(InspectEntity inspectEntity);
19
-
20
-    @Query(value = "select id from InspectEntity where inspectCode=:inspectCode")
21
-    Long selectIdByInspectCode(@Param("inspectCode")String inspectCode);
22
-
23
-    @Query(value = "select ie from InspectEntity ie where ie.inspectCode=:inspectCode")
24
-    List<InspectEntity> selectInspectByInspectCode(@Param("inspectCode")String inspectCode);
25
-
26
-    @Query(value = "select ie from InspectEntity ie where ie.inspectCode like CONCAT(:inspectCode,'%')")
27
-    List<InspectEntity> selectInspectByInspectCodeLike(@Param("inspectCode")String inspectCode);
28
-
29
-    @Query(value = "select ie from InspectEntity ie where ie.inspectState in (307,443) and ie.patientCode=:patientCode")
30
-    List<InspectEntity> selectInspectByPatientCode(@Param("patientCode")String patientCode);
31
-
32
-    @Modifying
33
-    @Transactional
34
-    @Query(value = "UPDATE itsm_transport_inspect set yytime = ?2 WHERE inspect_code = ?1",nativeQuery = true)
35
-    int upInspectYyTime(String inspectCode,String yytime);
36
-
37
-
38
-}

+ 0 - 18
src/main/java/com/dashitech/businessdata/dao/IJPBagDAO.java

@@ -1,18 +0,0 @@
1
-package com.dashitech.businessdata.dao;
2
-
3
-import com.dashitech.businessdata.entity.JPBagEntity;
4
-import org.springframework.data.jpa.repository.JpaRepository;
5
-import org.springframework.data.jpa.repository.Query;
6
-import org.springframework.data.repository.query.Param;
7
-
8
-/**
9
- * Created by chi on 2019/9/12.
10
- */
11
-public interface IJPBagDAO extends JpaRepository<JPBagEntity, String> {
12
-
13
-    @SuppressWarnings("unchecked")
14
-    JPBagEntity save(JPBagEntity jpBagEntity);
15
-
16
-    @Query(value = "select id from JPBagEntity where packid=:packid")
17
-    Long selectIdByPackid(@Param("packid")String packid);
18
-}

+ 0 - 12
src/main/java/com/dashitech/businessdata/dao/IJPDetailsDAO.java

@@ -1,12 +0,0 @@
1
-package com.dashitech.businessdata.dao;
2
-
3
-import com.dashitech.businessdata.entity.JPDetailsEntity;
4
-import org.springframework.data.jpa.repository.JpaRepository;
5
-
6
-/**
7
- * Created by chi on 2019/9/12.
8
- */
9
-public interface IJPDetailsDAO extends JpaRepository<JPDetailsEntity, String> {
10
-    @SuppressWarnings("unchecked")
11
-    JPDetailsEntity save(JPDetailsEntity jpDetailsEntity);
12
-}

+ 0 - 33
src/main/java/com/dashitech/businessdata/dao/IPatientDAO.java

@@ -1,33 +0,0 @@
1
-package com.dashitech.businessdata.dao;
2
-
3
-import com.dashitech.businessdata.entity.PatientEntity;
4
-import org.springframework.data.jpa.repository.JpaRepository;
5
-import org.springframework.data.jpa.repository.Modifying;
6
-import org.springframework.data.jpa.repository.Query;
7
-import org.springframework.transaction.annotation.Transactional;
8
-
9
-import java.util.List;
10
-
11
-/**
12
- * Created by chi on 2019/9/11.
13
- */
14
-public interface IPatientDAO extends JpaRepository<PatientEntity, String> {
15
-
16
-    @SuppressWarnings("unchecked")
17
-    PatientEntity save(PatientEntity patientEntity);
18
-
19
-    //@Query(value = "select id from PatientEntity where patientcode =?1 limit 1 ")
20
-    @Query(value = "select id from itsm_patient where patientcode =?1 limit 1 ",nativeQuery = true)
21
-    Integer selectIdByCode(String code);
22
-
23
-    @Query(value = "select * from itsm_patient where bednum is not null and pinyin is null",nativeQuery = true)
24
-    List<PatientEntity> selectPatient();
25
-
26
-    @Query(value = "select * from itsm_patient where patientcode =?1 limit 1 ",nativeQuery = true)
27
-    PatientEntity selectPatientByCode(String code);
28
-
29
-    @Modifying
30
-    @Transactional
31
-    @Query(value = "UPDATE itsm_patient set bednum = null WHERE patientcode <> ?1 and bednum = ?2 and roomnum = ?3 and department = ?4 ",nativeQuery = true)
32
-    int upPatientBednum(String patientcode,String bednum,String roomnum,Integer department);
33
-}

+ 0 - 20
src/main/java/com/dashitech/businessdata/dao/IPatientLogDAO.java

@@ -1,20 +0,0 @@
1
-package com.dashitech.businessdata.dao;
2
-
3
-import com.dashitech.businessdata.entity.PatientLogEntity;
4
-import org.springframework.data.jpa.repository.JpaRepository;
5
-import org.springframework.data.jpa.repository.Modifying;
6
-import org.springframework.data.jpa.repository.Query;
7
-import org.springframework.transaction.annotation.Transactional;
8
-
9
-/**
10
- * Created by xuweihua on 2021/1/13.
11
- */
12
-public interface IPatientLogDAO extends JpaRepository<PatientLogEntity, String> {
13
-    @SuppressWarnings("unchecked")
14
-    PatientLogEntity save(PatientLogEntity patientLogEntity);
15
-
16
-    @Modifying
17
-    @Transactional
18
-    @Query(value = "DELETE FROM itsm_patient_log WHERE time < date_add(now(),interval-1 month)",nativeQuery = true)
19
-    int deletePatientLog();
20
-}

+ 0 - 41
src/main/java/com/dashitech/businessdata/dao/ISpecimenDAO.java

@@ -1,41 +0,0 @@
1
-package com.dashitech.businessdata.dao;
2
-
3
-import com.dashitech.businessdata.entity.SpecimenEntity;
4
-import org.springframework.data.jpa.repository.JpaRepository;
5
-import org.springframework.data.jpa.repository.Modifying;
6
-import org.springframework.data.jpa.repository.Query;
7
-import org.springframework.data.repository.query.Param;
8
-import org.springframework.transaction.annotation.Transactional;
9
-
10
-import java.util.List;
11
-
12
-/**
13
- * Created by chi on 2019/9/10.
14
- */
15
-public interface ISpecimenDAO extends JpaRepository<SpecimenEntity, String> {
16
-
17
-    @SuppressWarnings("unchecked")
18
-    SpecimenEntity save(SpecimenEntity specimen);
19
-
20
-    @Query(value = "select se from SpecimenEntity se where id=:id")
21
-    SpecimenEntity getById(@Param("id") Long id);
22
-
23
-    @Query(value = "select id from SpecimenEntity where scode=:scode")
24
-    Long selectIdByScode(@Param("scode")String scode);
25
-
26
-    @Query(value = "SELECT id FROM itsm_uc_hospital WHERE _hos_no =?1 AND delete_flag = 0 ", nativeQuery = true)
27
-    Long getHosIdByCode(String gender);
28
-
29
-    @Query(value = "select se from SpecimenEntity se where se.orderNumber=:orderNumber")
30
-    List<SpecimenEntity> selectListByorderNumber(@Param("orderNumber")String orderNumber);
31
-
32
-    @Modifying
33
-    @Transactional
34
-    @Query(value = "UPDATE itsm_transport_specimen set spe_state = ?1 WHERE patient_no = ?2 and spe_state = 332 and gdid is null",nativeQuery = true)
35
-    int upSpecimenState(Long state,Integer patientNo);
36
-
37
-    @Modifying
38
-    @Transactional
39
-    @Query(value = "update itsm_transport_specimen SET spe_state = (SELECT id from itsm_base_dictionary WHERE _key = 'speState' and _value = '110') WHERE spe_state = (SELECT id from itsm_base_dictionary WHERE _key = 'speState' and _value = '1') and print_date <= date_add(now(),interval-1 day)",nativeQuery = true)
40
-    int upSpecimenState();
41
-}

+ 0 - 22
src/main/java/com/dashitech/businessdata/dao/ISpecimenHistoryDAO.java

@@ -1,22 +0,0 @@
1
-package com.dashitech.businessdata.dao;
2
-
3
-import com.dashitech.businessdata.entity.SpecimenEntity;
4
-import com.dashitech.businessdata.entity.SpecimenHistoryEntity;
5
-import org.springframework.data.jpa.repository.JpaRepository;
6
-import org.springframework.data.jpa.repository.Modifying;
7
-import org.springframework.data.jpa.repository.Query;
8
-import org.springframework.transaction.annotation.Transactional;
9
-
10
-/**
11
- * Created by xuweihua on 2020/12/17.
12
- */
13
-public interface ISpecimenHistoryDAO  extends JpaRepository<SpecimenHistoryEntity, String> {
14
-    @SuppressWarnings("unchecked")
15
-    SpecimenEntity save(SpecimenEntity specimen);
16
-
17
-
18
-    @Modifying
19
-    @Transactional
20
-    @Query(value = "DELETE FROM itsm_specimen_history WHERE creat_time < date_add(now(),interval-1 month)",nativeQuery = true)
21
-    int deleteSpecimenHistoryLog();
22
-}

+ 0 - 20
src/main/java/com/dashitech/businessdata/dao/IWorkOrderDAO.java

@@ -1,20 +0,0 @@
1
-package com.dashitech.businessdata.dao;
2
-
3
-import com.dashitech.businessdata.entity.WorkOrderEntity;
4
-import org.springframework.data.jpa.repository.JpaRepository;
5
-import org.springframework.data.jpa.repository.Query;
6
-
7
-import java.util.List;
8
-
9
-/**
10
- * Created by xuweihua on 2020/11/20.
11
- */
12
-public interface IWorkOrderDAO  extends JpaRepository<WorkOrderEntity, String> {
13
-    @SuppressWarnings("unchecked")
14
-    WorkOrderEntity save(WorkOrderEntity workOrderEntity);
15
-
16
-    @Query(value = "select * from itsm_transport_workorder where patientId =?1 and gdstate in(69,70,71,433) " +
17
-            "and task_type_id in (SELECT id from itsm_task_type WHERE delete_flag = 0 and association_type_id = " +
18
-            "(SELECT id from itsm_base_dictionary WHERE _key = 'association_types' and _value = 'inspect' LIMIT 1))",nativeQuery = true)
19
-    List<WorkOrderEntity> selectWorkOrderByPatientId(String patientId);
20
-}

+ 0 - 145
src/main/java/com/dashitech/businessdata/entity/DrugsBagEntity.java

@@ -1,145 +0,0 @@
1
-package com.dashitech.businessdata.entity;
2
-
3
-import com.dashitech.utils.I18n;
4
-import org.springframework.format.annotation.DateTimeFormat;
5
-
6
-import javax.persistence.*;
7
-import java.io.Serializable;
8
-import java.util.Date;
9
-
10
-/**
11
- * Created by chi on 2019/9/12.
12
- * 药品大包表
13
- *
14
- * launch、target 这里为编码 主表为id
15
- */
16
-@Entity
17
-@Table(name = "itsm_transport_drugs_bag")
18
-public class DrugsBagEntity implements Serializable {
19
-
20
-    private static final long serialVersionUID = 1L;
21
-    @Id
22
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
23
-    @Column(name="id",length = 20)
24
-    private Long id;
25
-
26
-    @I18n("来源科室(发药科室),这里为编码 主表为id")
27
-    @Column(name="launch")
28
-    private String launch;
29
-
30
-    @I18n("目标科室(申请科室),这里为编码 主表为id")
31
-    @Column(name="target")
32
-    private String target;
33
-
34
-    @I18n("药品包号")
35
-    @Column(name = "packid")
36
-    private String packid;
37
-
38
-    @I18n("药品状态")
39
-    @Column(name = "drugs_state")
40
-    private Long drugsState;
41
-
42
-    @I18n("打包时间")
43
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
44
-    @Column(name = "pack_time")
45
-    private Date packTime;
46
-
47
-    @I18n("批次创建时间")
48
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
49
-    @Column(name = "creat_time")
50
-    private Date creatTime;
51
-
52
-    @I18n("批次号")
53
-    @Column(name = "batch_No")
54
-    private String batchNo;
55
-
56
-    @I18n("院区编码")
57
-    @Column(name = "hos_id")
58
-    private String hosId;
59
-
60
-    public String getHosId() {
61
-        return hosId;
62
-    }
63
-
64
-    public void setHosId(String hosId) {
65
-        this.hosId = hosId;
66
-    }
67
-
68
-    public String getLaunch() {
69
-        return launch;
70
-    }
71
-
72
-    public void setLaunch(String launch) {
73
-        this.launch = launch;
74
-    }
75
-
76
-    public String getTarget() {
77
-        return target;
78
-    }
79
-
80
-    public void setTarget(String target) {
81
-        this.target = target;
82
-    }
83
-
84
-    public String getPackid() {
85
-        return packid;
86
-    }
87
-
88
-    public void setPackid(String packid) {
89
-        this.packid = packid;
90
-    }
91
-
92
-    public Long getDrugsState() {
93
-        return drugsState;
94
-    }
95
-
96
-    public void setDrugsState(Long drugsState) {
97
-        this.drugsState = drugsState;
98
-    }
99
-
100
-    public Date getPackTime() {
101
-        return packTime;
102
-    }
103
-
104
-    public void setPackTime(Date packTime) {
105
-        this.packTime = packTime;
106
-    }
107
-
108
-    public Long getId() {
109
-        return id;
110
-    }
111
-
112
-    public void setId(Long id) {
113
-        this.id = id;
114
-    }
115
-
116
-    public Date getCreatTime() {
117
-        return creatTime;
118
-    }
119
-
120
-    public void setCreatTime(Date creatTime) {
121
-        this.creatTime = creatTime;
122
-    }
123
-
124
-    public String getBatchNo() {
125
-        return batchNo;
126
-    }
127
-
128
-    public void setBatchNo(String batchNo) {
129
-        this.batchNo = batchNo;
130
-    }
131
-
132
-    @Override
133
-    public String toString() {
134
-        return "DrugsBagEntity{" +
135
-                "id=" + id +
136
-                ", launch='" + launch + '\'' +
137
-                ", target='" + target + '\'' +
138
-                ", packid='" + packid + '\'' +
139
-                ", drugsState=" + drugsState +
140
-                ", packTime=" + packTime +
141
-                ", creatTime=" + creatTime +
142
-                ", batchNo='" + batchNo + '\'' +
143
-                '}';
144
-    }
145
-}

+ 0 - 137
src/main/java/com/dashitech/businessdata/entity/DrugsEntity.java

@@ -1,137 +0,0 @@
1
-package com.dashitech.businessdata.entity;
2
-
3
-import com.dashitech.utils.I18n;
4
-
5
-import javax.persistence.*;
6
-import java.io.Serializable;
7
-
8
-/**
9
- * Created by chi on 2019/9/10.
10
- */
11
-@Entity
12
-@Table(name = "itsm_transport_drugs")
13
-public class DrugsEntity implements Serializable {
14
-
15
-    private static final long serialVersionUID = 1L;
16
-
17
-    @Id
18
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
19
-    @Column(name="id",length = 20)
20
-    private Integer id;
21
-
22
-    @I18n("病人唯一标识")
23
-    @Column(name = "patient_no")
24
-    private String patientNo;
25
-
26
-    @I18n("病人信息")
27
-    @Column(name = "patient_info")
28
-    private String patientInfo;
29
-
30
-    @I18n("药品具体信息")
31
-    @Column(name = "drugs_info")
32
-    private String drugsInfo;
33
-
34
-    @I18n("药品计量")
35
-    @Column(name = "drugs_num")
36
-    private Integer drugsNum;
37
-
38
-    @I18n("打包号批次号")
39
-    @Column(name = "bag_id")
40
-    private Long bagId;
41
-
42
-    @I18n("床号")
43
-    @Column(name = "bed_num")
44
-    private String bedNum;
45
-
46
-    @I18n("院区编码")
47
-    @Column(name = "hos_id")
48
-    private String hosId;
49
-
50
-    @I18n("药品类型")
51
-    @Column(name = "drug_type")
52
-    private String drugType;
53
-
54
-    public String getDrugType() {
55
-        return drugType;
56
-    }
57
-
58
-    public void setDrugType(String drugType) {
59
-        this.drugType = drugType;
60
-    }
61
-
62
-    public String getHosId() {
63
-        return hosId;
64
-    }
65
-
66
-    public void setHosId(String hosId) {
67
-        this.hosId = hosId;
68
-    }
69
-    public Integer getId() {
70
-        return id;
71
-    }
72
-
73
-    public void setId(Integer id) {
74
-        this.id = id;
75
-    }
76
-
77
-    public String getPatientNo() {
78
-        return patientNo;
79
-    }
80
-
81
-    public void setPatientNo(String patientNo) {
82
-        this.patientNo = patientNo;
83
-    }
84
-
85
-    public String getPatientInfo() {
86
-        return patientInfo;
87
-    }
88
-
89
-    public void setPatientInfo(String patientInfo) {
90
-        this.patientInfo = patientInfo;
91
-    }
92
-
93
-    public String getDrugsInfo() {
94
-        return drugsInfo;
95
-    }
96
-
97
-    public void setDrugsInfo(String drugsInfo) {
98
-        this.drugsInfo = drugsInfo;
99
-    }
100
-
101
-    public Integer getDrugsNum() {
102
-        return drugsNum;
103
-    }
104
-
105
-    public void setDrugsNum(Integer drugsNum) {
106
-        this.drugsNum = drugsNum;
107
-    }
108
-
109
-    public Long getBagId() {
110
-        return bagId;
111
-    }
112
-
113
-    public void setBagId(Long bagId) {
114
-        this.bagId = bagId;
115
-    }
116
-
117
-    public String getBedNum() {
118
-        return bedNum;
119
-    }
120
-
121
-    public void setBedNum(String bedNum) {
122
-        this.bedNum = bedNum;
123
-    }
124
-
125
-    @Override
126
-    public String toString() {
127
-        return "DrugsEntity{" +
128
-                "id=" + id +
129
-                ", patientNo='" + patientNo + '\'' +
130
-                ", patientInfo='" + patientInfo + '\'' +
131
-                ", drugsInfo='" + drugsInfo + '\'' +
132
-                ", drugsNum=" + drugsNum +
133
-                ", bagId=" + bagId +
134
-                ", bedNum='" + bedNum + '\'' +
135
-                '}';
136
-    }
137
-}

+ 0 - 270
src/main/java/com/dashitech/businessdata/entity/InspectEntity.java

@@ -1,270 +0,0 @@
1
-package com.dashitech.businessdata.entity;
2
-
3
-import com.dashitech.utils.I18n;
4
-import org.springframework.format.annotation.DateTimeFormat;
5
-
6
-import javax.persistence.*;
7
-import java.io.Serializable;
8
-import java.util.Date;
9
-
10
-/**
11
- * Created by chi on 2019/9/12.
12
- * 送检信息,病人检查
13
- * execDept、applyDept 主表为id,这里是编码
14
- */
15
-@Entity
16
-@Table(name = "itsm_transport_inspect")
17
-public class InspectEntity implements Serializable {
18
-    private static final long serialVersionUID = 1L;
19
-
20
-    @Id
21
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
22
-    @Column(name="id",length = 20)
23
-    private Long id;
24
-
25
-    @I18n("病人标识")
26
-    @Column(name = "patient_code")
27
-    private String patientCode;
28
-
29
-    @I18n("病人姓名")
30
-    @Column(name = "patient_name")
31
-    private String patientName;
32
-
33
-    @I18n("腕带条码")
34
-    @Column(name = "patient_bar_code")
35
-    private String barCode;
36
-
37
-    @I18n("状态")//待检查  待到达 待送达 检查中 已完成,申请
38
-    @Column(name="inspect_state")
39
-    private Integer inspectState;
40
-
41
-    @I18n("自定义检查状态")
42
-    @Column(name = "inspect_check_type")
43
-    private Integer inspectCheckType;
44
-
45
-    @I18n("申请检查单标识")
46
-    @Column(name = "inspect_code")
47
-    private String inspectCode;
48
-
49
-    @I18n("检查标识类型")
50
-    @Column(name = "inspect_type_code")
51
-    private String inspectTypeCode;
52
-
53
-    @I18n("检查类型名称")
54
-    @Column(name = "inspect_type_name")
55
-    private String inspectName;
56
-
57
-    @I18n("申请科室,主表为id这里为编码")
58
-    @Column(name="apply_dept")
59
-    private String applyDept;
60
-
61
-    @I18n("检查部位名称")
62
-    @Column(name = "inspect_bwname")
63
-    private String bwName;
64
-
65
-    @I18n("执行科室,主表为id这里为编码")
66
-    @Column(name="exec_Dept")
67
-    private String execDept;
68
-
69
-    @I18n("预约时间")
70
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
71
-    @Column(name = "yytime")
72
-    private Date yyTime;
73
-
74
-    @I18n("床号")
75
-    @Column(name = "bed_num")
76
-    private String bedNum;
77
-
78
-    @I18n("检查时间")
79
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
80
-    @Column(name = "inspect_time")
81
-    private Date inspectTime;
82
-
83
-    @I18n("检查人")
84
-    @Column(name = "inspector")
85
-    private String inspector;
86
-
87
-    @I18n("预约号码")
88
-    @Column(name = "reservation_number")
89
-    private String reservationNumber;
90
-
91
-    @I18n("优先级")
92
-    @Column(name = "priority")
93
-    private String priority;
94
-
95
-    @I18n("院区id")
96
-    @Column(name = "hos_id")
97
-    private Long hosId;
98
-
99
-    public Integer getInspectCheckType() {
100
-        return inspectCheckType;
101
-    }
102
-
103
-    public void setInspectCheckType(Integer inspectCheckType) {
104
-        this.inspectCheckType = inspectCheckType;
105
-    }
106
-
107
-    public Long getHosId() {
108
-        return hosId;
109
-    }
110
-
111
-    public void setHosId(Long hosId) {
112
-        this.hosId = hosId;
113
-    }
114
-
115
-    public String getPriority() {
116
-        return priority;
117
-    }
118
-
119
-    public void setPriority(String priority) {
120
-        this.priority = priority;
121
-    }
122
-
123
-    public String getReservationNumber() {
124
-        return reservationNumber;
125
-    }
126
-
127
-    public void setReservationNumber(String reservationNumber) {
128
-        this.reservationNumber = reservationNumber;
129
-    }
130
-
131
-    public String getInspectName() {
132
-        return inspectName;
133
-    }
134
-
135
-    public void setInspectName(String inspectName) {
136
-        this.inspectName = inspectName;
137
-    }
138
-
139
-    public Long getId() {
140
-        return id;
141
-    }
142
-
143
-    public void setId(Long id) {
144
-        this.id = id;
145
-    }
146
-
147
-    public String getPatientCode() {
148
-        return patientCode;
149
-    }
150
-
151
-    public void setPatientCode(String patientCode) {
152
-        this.patientCode = patientCode;
153
-    }
154
-
155
-    public String getPatientName() {
156
-        return patientName;
157
-    }
158
-
159
-    public void setPatientName(String patientName) {
160
-        this.patientName = patientName;
161
-    }
162
-
163
-    public String getBarCode() {
164
-        return barCode;
165
-    }
166
-
167
-    public void setBarCode(String barCode) {
168
-        this.barCode = barCode;
169
-    }
170
-
171
-    public Integer getInspectState() {
172
-        return inspectState;
173
-    }
174
-
175
-    public void setInspectState(Integer inspectState) {
176
-        this.inspectState = inspectState;
177
-    }
178
-
179
-    public String getInspectCode() {
180
-        return inspectCode;
181
-    }
182
-
183
-    public void setInspectCode(String inspectCode) {
184
-        this.inspectCode = inspectCode;
185
-    }
186
-
187
-    public String getInspectTypeCode() {
188
-        return inspectTypeCode;
189
-    }
190
-
191
-    public void setInspectTypeCode(String inspectTypeCode) {
192
-        this.inspectTypeCode = inspectTypeCode;
193
-    }
194
-
195
-    public String getBwName() {
196
-        return bwName;
197
-    }
198
-
199
-    public void setBwName(String bwName) {
200
-        this.bwName = bwName;
201
-    }
202
-
203
-    public Date getYyTime() {
204
-        return yyTime;
205
-    }
206
-
207
-    public void setYyTime(Date yyTime) {
208
-        this.yyTime = yyTime;
209
-    }
210
-
211
-    public String getBedNum() {
212
-        return bedNum;
213
-    }
214
-
215
-    public void setBedNum(String bedNum) {
216
-        this.bedNum = bedNum;
217
-    }
218
-
219
-    public Date getInspectTime() {
220
-        return inspectTime;
221
-    }
222
-
223
-    public void setInspectTime(Date inspectTime) {
224
-        this.inspectTime = inspectTime;
225
-    }
226
-
227
-    public String getInspector() {
228
-        return inspector;
229
-    }
230
-
231
-    public void setInspector(String inspector) {
232
-        this.inspector = inspector;
233
-    }
234
-
235
-    public String getApplyDept() {
236
-        return applyDept;
237
-    }
238
-
239
-    public void setApplyDept(String applyDept) {
240
-        this.applyDept = applyDept;
241
-    }
242
-
243
-    public String getExecDept() {
244
-        return execDept;
245
-    }
246
-
247
-    public void setExecDept(String execDept) {
248
-        this.execDept = execDept;
249
-    }
250
-
251
-    @Override
252
-    public String toString() {
253
-        return "InspectEntity{" +
254
-                "id=" + id +
255
-                ", patientCode='" + patientCode + '\'' +
256
-                ", patientName='" + patientName + '\'' +
257
-                ", barCode='" + barCode + '\'' +
258
-                ", inspectState=" + inspectState +
259
-                ", inspectCode='" + inspectCode + '\'' +
260
-                ", inspectTypeCode='" + inspectTypeCode + '\'' +
261
-                ", applyDept='" + applyDept + '\'' +
262
-                ", bwName='" + bwName + '\'' +
263
-                ", execDept='" + execDept + '\'' +
264
-                ", yyTime=" + yyTime +
265
-                ", bedNum='" + bedNum + '\'' +
266
-                ", inspectTime=" + inspectTime +
267
-                ", inspector='" + inspector + '\'' +
268
-                '}';
269
-    }
270
-}

+ 0 - 120
src/main/java/com/dashitech/businessdata/entity/JPBagEntity.java

@@ -1,120 +0,0 @@
1
-package com.dashitech.businessdata.entity;
2
-
3
-import com.dashitech.utils.I18n;
4
-import org.springframework.format.annotation.DateTimeFormat;
5
-
6
-import javax.persistence.*;
7
-import java.io.Serializable;
8
-import java.util.Date;
9
-
10
-/**
11
- * Created by chi on 2019/9/12.
12
- * 静配大包表
13
- * target、launch 这里为编码 主表为id
14
- */
15
-@Entity
16
-@Table(name = "itsm_jp_bag")
17
-public class JPBagEntity implements Serializable {
18
-
19
-    private static final long serialVersionUID = 1L;
20
-
21
-    @Id
22
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
23
-    @Column(name="id",length = 20)
24
-    private Long id;
25
-
26
-    @I18n("大包id")
27
-    @Column(name = "packid")
28
-    private String packid;
29
-
30
-    @I18n("目标科室编码,这里为编码 主表为id(发起申请的临床科室编码)")
31
-    @Column(name = "target")
32
-    private String target;
33
-
34
-    @I18n("来源科室编码,这里为编码 主表为id(发药科室编码)")
35
-    @Column(name = "launch")
36
-    private String launch;
37
-
38
-    @I18n("大包创建时间")
39
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
40
-    @Column(name = "creat_time")
41
-    private Date creatTime;
42
-
43
-    @I18n("药品状态")
44
-    @Column(name = "jp_state")
45
-    private Integer jpState;
46
-
47
-    @I18n("院区编码")
48
-    @Column(name = "hos_id")
49
-    private String hosID;
50
-
51
-
52
-    public Long getId() {
53
-        return id;
54
-    }
55
-
56
-    public void setId(Long id) {
57
-        this.id = id;
58
-    }
59
-
60
-    public String getPackid() {
61
-        return packid;
62
-    }
63
-
64
-    public void setPackid(String packid) {
65
-        this.packid = packid;
66
-    }
67
-
68
-    public String getTarget() {
69
-        return target;
70
-    }
71
-
72
-    public void setTarget(String target) {
73
-        this.target = target;
74
-    }
75
-
76
-    public String getLaunch() {
77
-        return launch;
78
-    }
79
-
80
-    public void setLaunch(String launch) {
81
-        this.launch = launch;
82
-    }
83
-
84
-    public Date getCreatTime() {
85
-        return creatTime;
86
-    }
87
-
88
-    public void setCreatTime(Date creatTime) {
89
-        this.creatTime = creatTime;
90
-    }
91
-
92
-    public Integer getJpState() {
93
-        return jpState;
94
-    }
95
-
96
-    public void setJpState(Integer jpState) {
97
-        this.jpState = jpState;
98
-    }
99
-
100
-    public String getHosID() {
101
-        return hosID;
102
-    }
103
-
104
-    public void setHosID(String hosID) {
105
-        this.hosID = hosID;
106
-    }
107
-
108
-    @Override
109
-    public String toString() {
110
-        return "JPBagEntity{" +
111
-                "id=" + id +
112
-                ", packid='" + packid + '\'' +
113
-                ", target='" + target + '\'' +
114
-                ", launch='" + launch + '\'' +
115
-                ", creatTime=" + creatTime +
116
-                ", jpState=" + jpState +
117
-                ", hosID='" + hosID + '\'' +
118
-                '}';
119
-    }
120
-}

+ 0 - 114
src/main/java/com/dashitech/businessdata/entity/JPDetailsEntity.java

@@ -1,114 +0,0 @@
1
-package com.dashitech.businessdata.entity;
2
-
3
-import com.dashitech.utils.I18n;
4
-
5
-import javax.persistence.*;
6
-import java.io.Serializable;
7
-
8
-/**
9
- * Created by chi on 2019/9/12.
10
- * 静配详情
11
- */
12
-@Entity
13
-@Table(name = "itsm_jp_details")
14
-public class JPDetailsEntity implements Serializable {
15
-    private static final long serialVersionUID = 1L;
16
-
17
-    @Id
18
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
19
-    @Column(name="id",length = 20)
20
-    private Integer id;
21
-
22
-    @I18n("病人唯一标识")
23
-    @Column(name = "patient_no")
24
-    private String patientNo;
25
-
26
-    @I18n("病人信息")
27
-    @Column(name = "patient_info")
28
-    private String patientInfo;
29
-
30
-    @I18n("药品具体信息")
31
-    @Column(name = "jp_info")
32
-    private String jpInfo;
33
-
34
-    @I18n("药品计量")
35
-    @Column(name = "jp_num")
36
-    private Integer jpNum;
37
-
38
-    @I18n("关联大包,批次号")
39
-    @Column(name = "bag_id")
40
-    private Long bagId;
41
-
42
-    @I18n("床号")
43
-    @Column(name = "bed_num")
44
-    private String bedNum;
45
-
46
-    public Integer getId() {
47
-        return id;
48
-    }
49
-
50
-    public void setId(Integer id) {
51
-        this.id = id;
52
-    }
53
-
54
-    public String getPatientNo() {
55
-        return patientNo;
56
-    }
57
-
58
-    public void setPatientNo(String patientNo) {
59
-        this.patientNo = patientNo;
60
-    }
61
-
62
-    public String getPatientInfo() {
63
-        return patientInfo;
64
-    }
65
-
66
-    public void setPatientInfo(String patientInfo) {
67
-        this.patientInfo = patientInfo;
68
-    }
69
-
70
-    public String getJpInfo() {
71
-        return jpInfo;
72
-    }
73
-
74
-    public void setJpInfo(String jpInfo) {
75
-        this.jpInfo = jpInfo;
76
-    }
77
-
78
-    public Integer getJpNum() {
79
-        return jpNum;
80
-    }
81
-
82
-    public void setJpNum(Integer jpNum) {
83
-        this.jpNum = jpNum;
84
-    }
85
-
86
-    public Long getBagId() {
87
-        return bagId;
88
-    }
89
-
90
-    public void setBagId(Long bagId) {
91
-        this.bagId = bagId;
92
-    }
93
-
94
-    public String getBedNum() {
95
-        return bedNum;
96
-    }
97
-
98
-    public void setBedNum(String bedNum) {
99
-        this.bedNum = bedNum;
100
-    }
101
-
102
-    @Override
103
-    public String toString() {
104
-        return "JPDetailsEntity{" +
105
-                "id=" + id +
106
-                ", patientNo='" + patientNo + '\'' +
107
-                ", patientInfo='" + patientInfo + '\'' +
108
-                ", jpInfo='" + jpInfo + '\'' +
109
-                ", jpNum=" + jpNum +
110
-                ", bagId=" + bagId +
111
-                ", bedNum='" + bedNum + '\'' +
112
-                '}';
113
-    }
114
-}

+ 0 - 236
src/main/java/com/dashitech/businessdata/entity/PatientEntity.java

@@ -1,236 +0,0 @@
1
-package com.dashitech.businessdata.entity;
2
-
3
-import com.dashitech.utils.I18n;
4
-import org.springframework.format.annotation.DateTimeFormat;
5
-
6
-import javax.persistence.*;
7
-import java.io.Serializable;
8
-import java.util.Date;
9
-
10
-/**
11
- * Created by chi on 2019/9/11.
12
- *
13
- * department主表为id 这里为编码
14
- */
15
-@Entity
16
-@Table(name = "itsm_patient")
17
-public class PatientEntity  implements Serializable {
18
-    private static final long serialVersionUID = 1L;
19
-
20
-    @Id
21
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
22
-    @Column(name="id",length = 20)
23
-    private Integer id;
24
-
25
-    @I18n("病人标识")
26
-    @Column(name = "patientcode")
27
-    private String patientcode;
28
-
29
-    @I18n("病人姓名")
30
-    @Column(name = "patientname")
31
-    private String patientname;
32
-
33
-    @I18n("住院科室id,主表为id这里为编码")
34
-    @Column(name = "department")
35
-    private Integer department;
36
-
37
-    @I18n("住院号")
38
-    @Column(name = "residence_no")
39
-    private String residenceNo;
40
-
41
-    @I18n("腕带条码")
42
-    @Column(name = "Bar_code")
43
-    private String barCode;
44
-
45
-    @I18n("房间号")
46
-    @Column(name = "roomnum")
47
-    private String roomnum;
48
-
49
-    @I18n("床号")
50
-    @Column(name = "bednum" )
51
-    private String bednum;
52
-
53
-    @I18n("年龄")
54
-    @Column(name = "age" )
55
-    private String age;
56
-
57
-    @Column(name = "VERSION" )
58
-    private Integer version;
59
-
60
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
61
-    @Column(name = "hospitalized_time" )
62
-    private Date hospitalizedTime;
63
-
64
-    @I18n("拼音")
65
-    @Column(name = "pinyin" )
66
-    private String pinyin;
67
-    @I18n("拼音简写")
68
-    @Column(name = "input_code" )
69
-    private String inputCode;
70
-
71
-    @I18n("是否重点关注,1为重点关注 0为不需重点关注")
72
-    @Column(name = "focus_patient")
73
-    private Integer focusPatient;
74
-
75
-    @I18n("院区id")
76
-    @Column(name = "hos_id")
77
-    private Long hosId;
78
-
79
-    @I18n("护理等级(字典表id)")
80
-    @Column(name = "level_of_care_id")
81
-    private Long levelOfCare;
82
-
83
-    @I18n("病情代理(字典表id)")
84
-    @Column(name = "state_of_an_illness_id")
85
-    private Long stateOfAnIllness;
86
-
87
-    public Long getStateOfAnIllness() {
88
-        return stateOfAnIllness;
89
-    }
90
-
91
-    public void setStateOfAnIllness(Long stateOfAnIllness) {
92
-        this.stateOfAnIllness = stateOfAnIllness;
93
-    }
94
-
95
-    public Long getLevelOfCare() {
96
-        return levelOfCare;
97
-    }
98
-
99
-    public void setLevelOfCare(Long levelOfCare) {
100
-        this.levelOfCare = levelOfCare;
101
-    }
102
-
103
-    public Long getHosId() {
104
-        return hosId;
105
-    }
106
-
107
-    public void setHosId(Long hosId) {
108
-        this.hosId = hosId;
109
-    }
110
-
111
-    public Integer getFocusPatient() {
112
-        return focusPatient;
113
-    }
114
-
115
-    public void setFocusPatient(Integer focusPatient) {
116
-        this.focusPatient = focusPatient;
117
-    }
118
-
119
-    public String getPinyin() {
120
-        return pinyin;
121
-    }
122
-
123
-    public void setPinyin(String pinyin) {
124
-        this.pinyin = pinyin;
125
-    }
126
-
127
-    public String getInputCode() {
128
-        return inputCode;
129
-    }
130
-
131
-    public void setInputCode(String inputCode) {
132
-        this.inputCode = inputCode;
133
-    }
134
-
135
-    public Integer getVersion() {
136
-        return version;
137
-    }
138
-
139
-    public void setVersion(Integer version) {
140
-        this.version = version;
141
-    }
142
-
143
-    public Date getHospitalizedTime() {
144
-        return hospitalizedTime;
145
-    }
146
-
147
-    public void setHospitalizedTime(Date hospitalizedTime) {
148
-        this.hospitalizedTime = hospitalizedTime;
149
-    }
150
-
151
-    public String getPatientcode() {
152
-        return patientcode;
153
-    }
154
-
155
-    public void setPatientcode(String patientcode) {
156
-        this.patientcode = patientcode;
157
-    }
158
-
159
-    public String getPatientname() {
160
-        return patientname;
161
-    }
162
-
163
-    public void setPatientname(String patientname) {
164
-        this.patientname = patientname;
165
-    }
166
-
167
-    public Integer getDepartment() {
168
-        return department;
169
-    }
170
-
171
-    public void setDepartment(Integer department) {
172
-        this.department = department;
173
-    }
174
-
175
-    public String getBarCode() {
176
-        return barCode;
177
-    }
178
-
179
-    public void setBarCode(String barCode) {
180
-        this.barCode = barCode;
181
-    }
182
-
183
-    public String getRoomnum() {
184
-        return roomnum;
185
-    }
186
-
187
-    public void setRoomnum(String roomnum) {
188
-        this.roomnum = roomnum;
189
-    }
190
-
191
-    public String getBednum() {
192
-        return bednum;
193
-    }
194
-
195
-    public void setBednum(String bednum) {
196
-        this.bednum = bednum;
197
-    }
198
-
199
-    public String getResidenceNo() {
200
-        return residenceNo;
201
-    }
202
-
203
-    public void setResidenceNo(String residenceNo) {
204
-        this.residenceNo = residenceNo;
205
-    }
206
-
207
-    public String getAge() {
208
-        return age;
209
-    }
210
-
211
-    public void setAge(String age) {
212
-        this.age = age;
213
-    }
214
-
215
-    public Integer getId() {
216
-        return id;
217
-    }
218
-
219
-    public void setId(Integer id) {
220
-        this.id = id;
221
-    }
222
-    @Override
223
-    public String toString() {
224
-        return "PatientEntity{" +
225
-                "id=" + id +
226
-                ", patientcode='" + patientcode + '\'' +
227
-                ", patientname='" + patientname + '\'' +
228
-                ", department='" + department + '\'' +
229
-                ", residenceNo='" + residenceNo + '\'' +
230
-                ", barCode='" + barCode + '\'' +
231
-                ", roomnum='" + roomnum + '\'' +
232
-                ", bednum='" + bednum + '\'' +
233
-                ", age='" + age + '\'' +
234
-                '}';
235
-    }
236
-}

+ 0 - 125
src/main/java/com/dashitech/businessdata/entity/PatientLogEntity.java

@@ -1,125 +0,0 @@
1
-package com.dashitech.businessdata.entity;
2
-
3
-import com.dashitech.utils.I18n;
4
-import org.springframework.format.annotation.DateTimeFormat;
5
-
6
-import javax.persistence.*;
7
-import java.io.Serializable;
8
-import java.util.Date;
9
-
10
-/**
11
- * Created by xuweihua on 2021/1/12.
12
- */
13
-@Entity
14
-@Table(name = "itsm_patient_log")
15
-public class PatientLogEntity implements Serializable {
16
-    private static final long serialVersionUID = 1L;
17
-    @Id
18
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
19
-    @Column(name="id",length = 20)
20
-    private Long id;
21
-
22
-    @I18n("类型")
23
-    @Column(name = "type")
24
-    private Long type;
25
-
26
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
27
-    @Column(name = "time" )
28
-    private Date time;
29
-
30
-    @I18n("申请科室")
31
-    @Column(name = "sq_dept")
32
-    private Long sqDept;
33
-
34
-    @I18n("转入科室")
35
-    @Column(name = "zr_dept")
36
-    private Long zrDept;
37
-
38
-    @I18n("病人id")
39
-    @Column(name = "patient_id")
40
-    private Long patientId;
41
-
42
-    @I18n("前床号")
43
-    @Column(name = "qbednum")
44
-    private String qbednum;
45
-
46
-    @I18n("床号")
47
-    @Column(name = "bednum")
48
-    private String bednum;
49
-
50
-    @I18n("院区id")
51
-    @Column(name = "hos_id")
52
-    private Long hosId;
53
-
54
-    public Long getHosId() {
55
-        return hosId;
56
-    }
57
-
58
-    public void setHosId(Long hosId) {
59
-        this.hosId = hosId;
60
-    }
61
-
62
-    public String getQbednum() {
63
-        return qbednum;
64
-    }
65
-
66
-    public void setQbednum(String qbednum) {
67
-        this.qbednum = qbednum;
68
-    }
69
-
70
-    public String getBednum() {
71
-        return bednum;
72
-    }
73
-
74
-    public void setBednum(String bednum) {
75
-        this.bednum = bednum;
76
-    }
77
-
78
-    public Long getId() {
79
-        return id;
80
-    }
81
-
82
-    public void setId(Long id) {
83
-        this.id = id;
84
-    }
85
-
86
-    public Long getType() {
87
-        return type;
88
-    }
89
-
90
-    public void setType(Long type) {
91
-        this.type = type;
92
-    }
93
-
94
-    public Date getTime() {
95
-        return time;
96
-    }
97
-
98
-    public void setTime(Date time) {
99
-        this.time = time;
100
-    }
101
-
102
-    public Long getSqDept() {
103
-        return sqDept;
104
-    }
105
-
106
-    public void setSqDept(Long sqDept) {
107
-        this.sqDept = sqDept;
108
-    }
109
-
110
-    public Long getZrDept() {
111
-        return zrDept;
112
-    }
113
-
114
-    public void setZrDept(Long zrDept) {
115
-        this.zrDept = zrDept;
116
-    }
117
-
118
-    public Long getPatientId() {
119
-        return patientId;
120
-    }
121
-
122
-    public void setPatientId(Long patientId) {
123
-        this.patientId = patientId;
124
-    }
125
-}

+ 0 - 291
src/main/java/com/dashitech/businessdata/entity/SpecimenEntity.java

@@ -1,291 +0,0 @@
1
-package com.dashitech.businessdata.entity;
2
-
3
-import com.dashitech.utils.I18n;
4
-import org.springframework.format.annotation.DateTimeFormat;
5
-
6
-import javax.persistence.*;
7
-import java.io.Serializable;
8
-import java.util.Date;
9
-
10
-/**
11
- * Created by chi on 2019/9/10.
12
- *标本
13
- * doctor、putNurse、collectNurse、inspector、patientNo、sickRoom、checkDept,主表为id 这里为编码
14
- */
15
-@Entity
16
-@Table(name = "itsm_transport_specimen")
17
-public class SpecimenEntity implements Serializable {
18
-    private static final long serialVersionUID = 1L;
19
-
20
-
21
-    @Id
22
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
23
-    @Column(name="id",length = 20)
24
-    private Long id;
25
-
26
-    @I18n("标本采集时间")
27
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
28
-    @Column(name = "print_date")
29
-    private Date printDate;
30
-
31
-    @I18n("医生申请时间")
32
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
33
-    @Column(name = "doctor_apply_time")
34
-    private Date doctorApplyTime;
35
-
36
-    @I18n("护士贴标时间")
37
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
38
-    @Column(name = "nurse_put_time")
39
-    private Date nursePutTime;
40
-
41
-
42
-    @I18n("采集护士,主表为id 这里为编码")
43
-    @Column(name="collect_nurse_id")
44
-    private String collectNurse;
45
-
46
-    @I18n("检验人员,主表为id 这里为编码")
47
-    @Column(name="inspector")
48
-    private String inspector;
49
-
50
-    @I18n("检验时间")
51
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
52
-    @Column(name = "inspection_time")
53
-    private Date inspectionTime;
54
-
55
-    @I18n("标本状态: 0新标本,1已取标本  2已送达标本")
56
-    @Column(name="spe_state")
57
-    private Integer speState;
58
-
59
-    @I18n("标本类型")
60
-    @Column(name="stype")
61
-    private String stype;
62
-
63
-    @I18n("标本条码")
64
-    @Column(name = "scode")
65
-    private String scode;
66
-
67
-    @I18n("病人唯一标识,主表为id 这里为编码")
68
-    @Column(name = "patient_no")
69
-    private String patientNo;
70
-
71
-    @I18n("病人姓名")
72
-    @Column(name = "patientname")
73
-    private String patientName;
74
-
75
-    @I18n("住院科室(起点科室),主表为id 这里为编码")
76
-    @Column(name="sick_room")
77
-    private String sickRoom;
78
-
79
-    @I18n("检验科室(目标科室),主表为id 这里为编码")
80
-    @Column(name="check_dept")
81
-    private String checkDept;
82
-
83
-    @I18n("房间号")
84
-    @Column(name = "roomnum")
85
-    private String roomNum;
86
-
87
-    @I18n("床号")
88
-    @Column(name = "bednum")
89
-    private String bedNum;
90
-
91
-    @I18n("是否紧急,0一般,1加急")
92
-    @Column(name = "urgent")
93
-    private Integer  urgent;
94
-
95
-    @I18n("院区编码")
96
-    @Column(name = "hos_id")
97
-    private String hosID;
98
-
99
-    @I18n("检验的单号")
100
-    @Column(name = "order_number")
101
-    private String orderNumber;
102
-
103
-    @I18n("系统送达时间")
104
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
105
-    @Column(name = "sys_arrive_time")
106
-    private Date sysArriveTime;
107
-
108
-    public Date getSysArriveTime() {
109
-        return sysArriveTime;
110
-    }
111
-
112
-    public void setSysArriveTime(Date sysArriveTime) {
113
-        this.sysArriveTime = sysArriveTime;
114
-    }
115
-
116
-    public String getOrderNumber() {
117
-        return orderNumber;
118
-    }
119
-
120
-    public void setOrderNumber(String orderNumber) {
121
-        this.orderNumber = orderNumber;
122
-    }
123
-
124
-    public Long getId() {
125
-        return id;
126
-    }
127
-
128
-    public void setId(Long id) {
129
-        this.id = id;
130
-    }
131
-
132
-    public Date getPrintDate() {
133
-        return printDate;
134
-    }
135
-
136
-    public void setPrintDate(Date printDate) {
137
-        this.printDate = printDate;
138
-    }
139
-
140
-    public Date getDoctorApplyTime() {
141
-        return doctorApplyTime;
142
-    }
143
-
144
-    public void setDoctorApplyTime(Date doctorApplyTime) {
145
-        this.doctorApplyTime = doctorApplyTime;
146
-    }
147
-
148
-    public Date getNursePutTime() {
149
-        return nursePutTime;
150
-    }
151
-
152
-    public void setNursePutTime(Date nursePutTime) {
153
-        this.nursePutTime = nursePutTime;
154
-    }
155
-
156
-    public String getCollectNurse() {
157
-        return collectNurse;
158
-    }
159
-
160
-    public void setCollectNurse(String collectNurse) {
161
-        this.collectNurse = collectNurse;
162
-    }
163
-
164
-    public void setSickRoom(String sickRoom) {
165
-        this.sickRoom = sickRoom;
166
-    }
167
-
168
-    public void setCheckDept(String checkDept) {
169
-        this.checkDept = checkDept;
170
-    }
171
-
172
-    public String getInspector() {
173
-        return inspector;
174
-    }
175
-
176
-    public void setInspector(String inspector) {
177
-        this.inspector = inspector;
178
-    }
179
-
180
-    public Date getInspectionTime() {
181
-        return inspectionTime;
182
-    }
183
-
184
-    public void setInspectionTime(Date inspectionTime) {
185
-        this.inspectionTime = inspectionTime;
186
-    }
187
-
188
-    public Integer getSpeState() {
189
-        return speState;
190
-    }
191
-
192
-    public void setSpeState(Integer speState) {
193
-        this.speState = speState;
194
-    }
195
-
196
-    public String getStype() {
197
-        return stype;
198
-    }
199
-
200
-    public void setStype(String stype) {
201
-        this.stype = stype;
202
-    }
203
-
204
-    public String getScode() {
205
-        return scode;
206
-    }
207
-
208
-    public void setScode(String scode) {
209
-        this.scode = scode;
210
-    }
211
-
212
-    public String getPatientNo() {
213
-        return patientNo;
214
-    }
215
-
216
-    public void setPatientNo(String patientNo) {
217
-        this.patientNo = patientNo;
218
-    }
219
-
220
-    public String getPatientName() {
221
-        return patientName;
222
-    }
223
-
224
-    public void setPatientName(String patientName) {
225
-        this.patientName = patientName;
226
-    }
227
-
228
-    public String getRoomNum() {
229
-        return roomNum;
230
-    }
231
-
232
-    public void setRoomNum(String roomNum) {
233
-        this.roomNum = roomNum;
234
-    }
235
-
236
-    public String getBedNum() {
237
-        return bedNum;
238
-    }
239
-
240
-    public void setBedNum(String bedNum) {
241
-        this.bedNum = bedNum;
242
-    }
243
-
244
-    public Integer getUrgent() {
245
-        return urgent;
246
-    }
247
-
248
-    public void setUrgent(Integer urgent) {
249
-        this.urgent = urgent;
250
-    }
251
-
252
-    public String getSickRoom() {
253
-        return sickRoom;
254
-    }
255
-
256
-    public String getCheckDept() {
257
-        return checkDept;
258
-    }
259
-
260
-    public String getHosID() {
261
-        return hosID;
262
-    }
263
-
264
-    public void setHosID(String hosID) {
265
-        this.hosID = hosID;
266
-    }
267
-
268
-    @Override
269
-    public String toString() {
270
-        return "SpecimenEntity{" +
271
-                "id=" + id +
272
-                ", printDate=" + printDate +
273
-                ", doctorApplyTime=" + doctorApplyTime +
274
-                ", nursePutTime=" + nursePutTime +
275
-                ", collectNurse='" + collectNurse + '\'' +
276
-                ", inspector='" + inspector + '\'' +
277
-                ", inspectionTime=" + inspectionTime +
278
-                ", speState=" + speState +
279
-                ", stype='" + stype + '\'' +
280
-                ", scode='" + scode + '\'' +
281
-                ", patientNo='" + patientNo + '\'' +
282
-                ", patientName='" + patientName + '\'' +
283
-                ", sickRoom='" + sickRoom + '\'' +
284
-                ", checkDept='" + checkDept + '\'' +
285
-                ", roomNum='" + roomNum + '\'' +
286
-                ", bedNum='" + bedNum + '\'' +
287
-                ", urgent=" + urgent +
288
-                ", hosID='" + hosID + '\'' +
289
-                '}';
290
-    }
291
-}

+ 0 - 91
src/main/java/com/dashitech/businessdata/entity/SpecimenHistoryEntity.java

@@ -1,91 +0,0 @@
1
-package com.dashitech.businessdata.entity;
2
-
3
-import com.dashitech.utils.I18n;
4
-import org.springframework.format.annotation.DateTimeFormat;
5
-
6
-import javax.persistence.*;
7
-import java.io.Serializable;
8
-import java.util.Date;
9
-import java.util.Dictionary;
10
-
11
-/**
12
- * Created by xuweihua on 2020/12/17.
13
- * 标本历史
14
- */
15
-@Entity
16
-@Table(name = "itsm_specimen_history")
17
-public class SpecimenHistoryEntity implements Serializable {
18
-    @Id
19
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
20
-    @Column(name="id",length = 20)
21
-    private Long id;
22
-
23
-    @I18n("创建")
24
-    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
25
-    @Column(name = "creat_time")
26
-    private Date creatTime;
27
-
28
-    @I18n("操作类型")
29
-    @Column(name="operation_type")
30
-    private Long operationType;
31
-
32
-    @I18n("操作人")
33
-    @Column(name = "operation_user_name")
34
-    private String operationUserName;
35
-
36
-    @I18n("操作人id")
37
-    @Column(name = "operation_user_id")
38
-    private Long operationUserId;
39
-
40
-    @I18n("标本编码")
41
-    @Column(name = "scode")
42
-    private String scode;
43
-
44
-    public Long getId() {
45
-        return id;
46
-    }
47
-
48
-    public void setId(Long id) {
49
-        this.id = id;
50
-    }
51
-
52
-    public Date getCreatTime() {
53
-        return creatTime;
54
-    }
55
-
56
-    public void setCreatTime(Date creatTime) {
57
-        this.creatTime = creatTime;
58
-    }
59
-
60
-    public Long getOperationType() {
61
-        return operationType;
62
-    }
63
-
64
-    public void setOperationType(Long operationType) {
65
-        this.operationType = operationType;
66
-    }
67
-
68
-    public String getOperationUserName() {
69
-        return operationUserName;
70
-    }
71
-
72
-    public void setOperationUserName(String operationUserName) {
73
-        this.operationUserName = operationUserName;
74
-    }
75
-
76
-    public Long getOperationUserId() {
77
-        return operationUserId;
78
-    }
79
-
80
-    public void setOperationUserId(Long operationUserId) {
81
-        this.operationUserId = operationUserId;
82
-    }
83
-
84
-    public String getScode() {
85
-        return scode;
86
-    }
87
-
88
-    public void setScode(String scode) {
89
-        this.scode = scode;
90
-    }
91
-}

+ 0 - 88
src/main/java/com/dashitech/businessdata/entity/WorkOrderEntity.java

@@ -1,88 +0,0 @@
1
-package com.dashitech.businessdata.entity;
2
-
3
-import com.dashitech.utils.I18n;
4
-
5
-import javax.persistence.*;
6
-import java.io.Serializable;
7
-
8
-/**
9
- * Created by xuweihua on 2020/11/20.
10
- */
11
-@Entity
12
-@Table(name = "itsm_transport_workorder")
13
-public class WorkOrderEntity  implements Serializable {
14
-    private static final long serialVersionUID = 1L;
15
-
16
-    @Id
17
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
18
-    @Column(name="id",length = 20)
19
-    private Integer id;
20
-
21
-    // 创建科室不展示实体
22
-    @I18n("创建科室")
23
-    @Column(name="create_department_id")
24
-    private Integer  createDept;
25
-    @I18n("起点科室id")
26
-    @Column(name="start_department_id")
27
-    private Integer  startDept;
28
-
29
-    @I18n("终点科室")
30
-    @Column(name="end_department_ids")
31
-    private String endDeptIds;
32
-
33
-    @I18n("工单状态")
34
-    @Column(name="gdstate")
35
-    private Integer  gdState;
36
-
37
-    @I18n("病人唯一标识")
38
-    @Column(name="patientId")
39
-    private String patientId;
40
-
41
-    public Integer getId() {
42
-        return id;
43
-    }
44
-
45
-    public void setId(Integer id) {
46
-        this.id = id;
47
-    }
48
-
49
-    public Integer getStartDept() {
50
-        return startDept;
51
-    }
52
-
53
-    public void setStartDept(Integer startDept) {
54
-        this.startDept = startDept;
55
-    }
56
-
57
-    public Integer getGdState() {
58
-        return gdState;
59
-    }
60
-
61
-    public void setGdState(Integer gdState) {
62
-        this.gdState = gdState;
63
-    }
64
-
65
-    public String getPatientId() {
66
-        return patientId;
67
-    }
68
-
69
-    public void setPatientId(String patientId) {
70
-        this.patientId = patientId;
71
-    }
72
-
73
-    public Integer getCreateDept() {
74
-        return createDept;
75
-    }
76
-
77
-    public void setCreateDept(Integer createDept) {
78
-        this.createDept = createDept;
79
-    }
80
-
81
-    public String getEndDeptIds() {
82
-        return endDeptIds;
83
-    }
84
-
85
-    public void setEndDeptIds(String endDeptIds) {
86
-        this.endDeptIds = endDeptIds;
87
-    }
88
-}

+ 51 - 0
src/main/java/com/dashitech/callcenter/init/TestInit.java

@@ -0,0 +1,51 @@
1
+package com.dashitech.callcenter.init;
2
+
3
+import com.dashitech.hsms.dao.IHsmsCallLogDAO;
4
+import com.dashitech.hsms.entity.HsmsCallLogEntity;
5
+import org.apache.commons.logging.Log;
6
+import org.apache.commons.logging.LogFactory;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.boot.ApplicationArguments;
9
+import org.springframework.boot.ApplicationRunner;
10
+import org.springframework.context.annotation.Bean;
11
+import org.springframework.context.annotation.Lazy;
12
+import org.springframework.core.annotation.Order;
13
+import org.springframework.stereotype.Service;
14
+
15
+import java.util.Date;
16
+
17
+@Service
18
+@Order(10)
19
+public class TestInit implements ApplicationRunner {
20
+
21
+    private static Log log = LogFactory.getLog(TestInit.class);
22
+    @Autowired
23
+    private IHsmsCallLogDAO hsmsCallLogDAO;
24
+
25
+    @Override
26
+    public void run(ApplicationArguments args) throws Exception {
27
+//        testHsmsCallLogEntity();
28
+
29
+
30
+
31
+    }
32
+
33
+    private void testHsmsCallLogEntity() {
34
+        log.info("start");
35
+        HsmsCallLogEntity hsmsCallLog = new HsmsCallLogEntity();
36
+        hsmsCallLog.setVersion(0);
37
+        hsmsCallLog.setCallDept(null);
38
+        hsmsCallLog.setCallAccept("AAAAAAAAA");
39
+        hsmsCallLog.setPhyIDA("1111");
40
+        hsmsCallLog.setdTMFA("2222");
41
+        hsmsCallLog.setdTMFB("33333");
42
+        hsmsCallLog.setResponseTime(new Date());
43
+        hsmsCallLog.setLongTime("123");
44
+        hsmsCallLog.setPath("d:/a.txt");
45
+        hsmsCallLog.setCallType(1);
46
+        hsmsCallLog.setCallState(1);
47
+        hsmsCallLog.setHosId(1);
48
+        hsmsCallLogDAO.save(hsmsCallLog);
49
+        log.info("保存HSMS通话记录完成!");
50
+    }
51
+}

+ 113 - 21
src/main/java/com/dashitech/callcenter/socket/HandlerThread.java

@@ -5,6 +5,8 @@ import com.dashitech.businessdata.entity.CallLogEntity;
5 5
 import com.dashitech.businessdata.entity.CallRecordEntity;
6 6
 import com.dashitech.businessdata.entity.HospitalConfig;
7 7
 import com.dashitech.callcenter.webSocket.service.PhoneWebSocket;
8
+import com.dashitech.hsms.dao.IHsmsCallLogDAO;
9
+import com.dashitech.hsms.entity.HsmsCallLogEntity;
8 10
 import com.dashitech.utils.DateUtil2;
9 11
 import com.dashitech.utils.JsonUtil;
10 12
 import com.dashitech.utils.PropertiesUtil;
@@ -36,6 +38,13 @@ public class HandlerThread  {
36 38
 
37 39
     private static ICallRecordDAO callRecordDAO;
38 40
 
41
+    private static IHsmsCallLogDAO hsmsCallLogDAO;
42
+
43
+    @Autowired
44
+    public void setHsmsCallRecordDAO(IHsmsCallLogDAO hsmsCallLogDAO) {
45
+        HandlerThread.hsmsCallLogDAO = hsmsCallLogDAO;
46
+    }
47
+
39 48
     @Autowired
40 49
     public void setCallRecordDAO(ICallRecordDAO callRecordDAO) {
41 50
         HandlerThread.callRecordDAO = callRecordDAO;
@@ -65,6 +74,7 @@ public class HandlerThread  {
65 74
     }
66 75
 
67 76
     private static String project;
77
+    private static String projectMain;
68 78
     private static String recordNginxPath;
69 79
     private static String recordRegex;
70 80
 
@@ -74,6 +84,7 @@ public class HandlerThread  {
74 84
 
75 85
     private static Map<String,CallLogEntity> phoneLog = new HashMap<>();
76 86
     private String his = "";
87
+    private String serialNo = "";
77 88
     public HandlerThread() {
78 89
     }
79 90
 
@@ -108,6 +119,7 @@ public class HandlerThread  {
108 119
 
109 120
                 if(project == null) {
110 121
                     project = PropertiesUtil.getProperty("project");
122
+                    projectMain = PropertiesUtil.getProperty("project.main");
111 123
                     recordNginxPath = PropertiesUtil.getProperty("db.hjzx.record.nginx");
112 124
                     recordRegex = PropertiesUtil.getProperty("db.hjzx.record.path.regex");
113 125
                 }
@@ -134,15 +146,20 @@ public class HandlerThread  {
134 146
                     if (data.indexOf("loginreq") >= 0){
135 147
                         //{"cmd":"loginreq","ipaddr":"192.168.25.37","serialNo":"21380501019804","recordNumber":4,"webport":80,"filestoretype":0}his
136 148
                         if(JsonUtil.toJSONObject(data).containsKey("serialNo")){
137
-                            his = JsonUtil.toJSONObject(data).getString("serialNo");
149
+                            serialNo = JsonUtil.toJSONObject(data).getString("serialNo");
138 150
                         }else{
139
-                            his = JsonUtil.toJSONObject(data).getString("sernelNo");
151
+                            serialNo = JsonUtil.toJSONObject(data).getString("sernelNo");
140 152
                         }
141 153
                         // 设备 21040501017523 写死支持 院区1
142
-                        if(his.equals("21040501017523")){
154
+                        if(serialNo.equals("21040501017523")){
143 155
                             his = "1";
144 156
                         }else{
145
-                            his = callLogDAO.selectSernelNo("sernelNo",his);
157
+                            //呼叫中心,以转运项目为主
158
+                            if("HSMS".equals(projectMain)) {
159
+                                his = hsmsCallLogDAO.selectSernelNo("sernelNo",serialNo);
160
+                            } else {    //其它,以运维项目为主
161
+                                his = callLogDAO.selectSernelNo("sernelNo",serialNo);
162
+                            }
146 163
                         }
147 164
                         dataStr = "{\"cmd\":\"loginres\", \"error\":\"0\", \"timestamp\":\"" + (System.currentTimeMillis() / 1000) + "\"}";
148 165
                     }
@@ -261,6 +278,7 @@ public class HandlerThread  {
261 278
                                 }
262 279
 
263 280
                                 saveItsmCallRecord(callLogEntity,jsonObject.optString("uuid"));
281
+                                saveHsmsCallLog(callLogEntity,jsonObject.optString("uuid"));
264 282
                             }else {
265 283
                                 rMap.put("phone","");
266 284
                                 rMap.put("status", 201);
@@ -302,7 +320,7 @@ public class HandlerThread  {
302 320
                     callLog.setCallDept("暂无");
303 321
                 }
304 322
                 callLog.setHosId(Integer.parseInt(his));
305
-                callLogDAO.save(callLog);
323
+//                callLogDAO.save(callLog);
306 324
 
307 325
                 log.info("先保存通话记录1:"+jsonObject.toString());
308 326
                 //TODO 先保存通话记录,打不通的走这里
@@ -311,6 +329,7 @@ public class HandlerThread  {
311 329
                 }
312 330
 
313 331
                 saveItsmCallRecord(callLog,jsonObject.optString("uuid"));
332
+                saveHsmsCallLog(callLog,jsonObject.optString("uuid"));
314 333
 
315 334
             }
316 335
         }else if(jsonObject.get("phonestate").toString().equals("1")){
@@ -414,9 +433,10 @@ public class HandlerThread  {
414 433
                     callLog.setCallState(0);
415 434
                 }
416 435
                 callLog.setHosId(Integer.parseInt(his));
417
-                callLogDAO.save(callLog);
436
+//                callLogDAO.save(callLog);
418 437
                 //TODO 根据配置文件开关,是否保存到ITSM的通话记录数据
419 438
                 saveItsmCallRecord(callLog,null);
439
+                saveHsmsCallLog(callLog,null);
420 440
             }
421 441
         }
422 442
     }
@@ -453,9 +473,12 @@ public class HandlerThread  {
453 473
      */
454 474
     private void saveItsmCallRecord(CallLogEntity callLog,String uuid) {
455 475
         try {
456
-            if("ITSM".equals(project)) {
476
+            if("ITSM".equals(project) || "ALL".equals(project)) {
457 477
                 CallRecordEntity recordEntity = null;
458
-                log.info("开始保存通话记录");
478
+                log.info("开始保存ITSM通话记录");
479
+
480
+                String hosId = callLogDAO.selectSernelNo("sernelNo",serialNo);
481
+
459 482
                 //TODO 根据uuid区分是:新增通话记录,还是修改附件的通话记录
460 483
                 if(StringUtils.isNotEmpty(uuid)) {   //新增
461 484
                     Long id = callRecordDAO.selectIdByUuid(uuid);
@@ -469,7 +492,7 @@ public class HandlerThread  {
469 492
                         recordEntity.setIsAnswered(callLog.getCallState());
470 493
                         recordEntity.setCallTime("0");
471 494
                         recordEntity.setOverTime(new Date());
472
-                        recordEntity.setBranch(callLog.getHosId() == null ? null : callLog.getHosId().longValue());
495
+                        recordEntity.setBranch(StringUtils.isEmpty(hosId)? null : Long.valueOf(hosId));
473 496
                         if(callLog.getCallType() != null && "0".equals(callLog.getCallType().toString())) {
474 497
                             recordEntity.setCallType("1");
475 498
                         }else if(callLog.getCallType() != null && "1".equals(callLog.getCallType().toString())) {
@@ -477,21 +500,22 @@ public class HandlerThread  {
477 500
                         }
478 501
                         recordEntity.setGateWay(callLog.getPhyIDA());
479 502
                         callRecordDAO.save(recordEntity);
480
-                        log.info("新增临时通话记录完成");
503
+                        log.info("新增ITSM临时通话记录完成");
504
+
481 505
                     }else {
482
-                        log.info("已有临时通话记录,忽略此条uuid:"+uuid);
506
+                        log.info("已有ITSM临时通话记录,忽略此条uuid:"+uuid);
483 507
                     }
484 508
                 }else { //修改
485
-                    log.info("开始匹配临时通话记录");
509
+                    log.info("开始匹配ITSM临时通话记录");
486 510
                     recordEntity = callRecordDAO.selectByParams(callLog.getdTMFA(), callLog.getdTMFB(), callLog.getResponseTime());
487 511
 
488 512
                     //TODO 根据【主叫、被叫、起始时间】判断是否查询到对应数据,来绑定附件,如果未匹配到,直接新增
489 513
                     String newUUID = null;
490 514
                     if(recordEntity != null) {
491
-                        log.info("匹配到临时通话记录!开始修改");
515
+                        log.info("匹配到ITSM临时通话记录!开始修改");
492 516
                         newUUID = recordEntity.getCallAccept();
493 517
                     }else {
494
-                        log.info("未匹配到临时通话记录!开始新增");
518
+                        log.info("未匹配ITSM到临时通话记录!开始新增");
495 519
                         recordEntity = new CallRecordEntity();
496 520
                         newUUID = UUID.randomUUID().toString();
497 521
                     }
@@ -511,9 +535,7 @@ public class HandlerThread  {
511 535
                         recordEntity.setOverTime(overTime);
512 536
                     }
513 537
                     //院区
514
-                    if(callLog.getHosId() != null) {
515
-                        recordEntity.setBranch(callLog.getHosId().longValue());
516
-                    }
538
+                    recordEntity.setBranch(StringUtils.isEmpty(hosId)? null : Long.valueOf(hosId));
517 539
                     //呼入呼出,其它
518 540
                     if(callLog.getCallType() != null) {
519 541
                         if("1".equals(callLog.getCallType().toString())) {
@@ -533,20 +555,90 @@ public class HandlerThread  {
533 555
                         }
534 556
                         recordEntity.setRecordingFileName(newPath);
535 557
                     }else {
536
-                        log.info("callLog 保存没有路径path");
558
+                        log.info("ITSM callLog 保存没有路径path");
537 559
                         return;
538 560
                     }
539 561
 
540 562
                     callRecordDAO.save(recordEntity);
541
-                    log.info("附件通话记录保存完成");
563
+                    log.info("ITSM附件通话记录保存完成");
564
+                }
565
+
566
+                log.info("保存ITSM通话记录完成:"+recordEntity.getCallAccept());
567
+                System.out.println("保存ITSM通话记录完成:"+recordEntity.getCallAccept());
568
+            }
569
+        } catch (Exception ex) {
570
+            ex.printStackTrace();
571
+        }
572
+    }
573
+
574
+    private void saveHsmsCallLog(CallLogEntity callLog,String uuid) {
575
+        log.info("开始保存HSMS通话记录2");
576
+        HsmsCallLogEntity hsmsCallLog = null;
577
+
578
+        try {
579
+            if("HSMS".equals(project) || "ALL".equals(project)) {
580
+                String hosId = hsmsCallLogDAO.selectSernelNo("sernelNo",serialNo);
581
+
582
+                if(StringUtils.isNotEmpty(uuid)) {
583
+                    Long id = callRecordDAO.selectIdByUuid(uuid);
584
+                    if(id == null) {
585
+                        hsmsCallLog = new HsmsCallLogEntity();
586
+                        copyCallLog(callLog,hsmsCallLog);
587
+                        hsmsCallLog.setCallAccept(uuid);
588
+                        hsmsCallLog.setHosId(StringUtils.isEmpty(hosId)? null : Integer.valueOf(hosId));
589
+                        hsmsCallLogDAO.save(hsmsCallLog);
590
+                        log.info("新增HSMS临时通话记录完成");
591
+                    }else {
592
+                        log.info("已有HSMS临时通话记录,忽略此条uuid:"+uuid);
593
+                    }
594
+                }else {
595
+                    log.info("开始匹配HSMS临时通话记录");
596
+                    hsmsCallLog = hsmsCallLogDAO.selectByParams(callLog.getdTMFA(), callLog.getdTMFB(), callLog.getResponseTime());
597
+                    if(hsmsCallLog == null) {   //新增
598
+                        hsmsCallLog = new HsmsCallLogEntity();
599
+                        copyCallLog(callLog,hsmsCallLog);
600
+                        hsmsCallLog.setVersion(0);
601
+                        hsmsCallLog.setCallAccept(UUID.randomUUID().toString());
602
+                        hsmsCallLog.setHosId(StringUtils.isEmpty(hosId)? null : Integer.valueOf(hosId));
603
+                    }
604
+                    if(callLog.getPath() != null && StringUtils.isNotEmpty(callLog.getPath())) {
605
+                        String newPath = callLog.getPath();
606
+                        String[] arr = callLog.getPath().split(recordRegex);
607
+                        if (arr.length > 1) {
608
+                            newPath = recordNginxPath + arr[1];
609
+                        }
610
+                        hsmsCallLog.setPath(newPath);
611
+                    }else {
612
+                        log.info("HSMS callLog 保存没有路径path");
613
+                        return;
614
+                    }
615
+                    hsmsCallLogDAO.save(hsmsCallLog);
616
+                    log.info("保存HSMS通话记录2完成!");
542 617
                 }
543 618
 
544
-                log.info("ITSM保存通话记录完成:"+recordEntity.getCallAccept());
545
-                System.out.println("ITSM保存通话记录完成:"+recordEntity.getCallAccept());
619
+                log.info("保存HSMS通话记录完成:"+hsmsCallLog.getCallAccept());
546 620
             }
547 621
         } catch (Exception ex) {
548 622
             ex.printStackTrace();
549 623
         }
624
+
625
+    }
626
+
627
+    private HsmsCallLogEntity copyCallLog(CallLogEntity callLog,HsmsCallLogEntity hsmsCallLog) {
628
+        hsmsCallLog.setId(callLog.getId());
629
+        hsmsCallLog.setVersion(callLog.getVersion());
630
+        hsmsCallLog.setHosId(callLog.getHosId());
631
+        hsmsCallLog.setCallAccept(callLog.getCallDept());
632
+        hsmsCallLog.setCallDept(callLog.getCallDept());
633
+        hsmsCallLog.setPhyIDA(callLog.getPhyIDA());
634
+        hsmsCallLog.setdTMFA(callLog.getdTMFA());
635
+        hsmsCallLog.setdTMFB(callLog.getdTMFB());
636
+        hsmsCallLog.setResponseTime(callLog.getResponseTime());
637
+        hsmsCallLog.setLongTime(callLog.getLongTime());
638
+        hsmsCallLog.setPath(callLog.getPath());
639
+        hsmsCallLog.setCallType(callLog.getCallType());
640
+        hsmsCallLog.setCallState(callLog.getCallState());
641
+        return hsmsCallLog;
550 642
     }
551 643
 
552 644
     public static void main(String[] args) {

+ 11 - 0
src/main/java/com/dashitech/config/DataSourceConfig.java

@@ -19,6 +19,17 @@ import javax.sql.DataSource;
19 19
 public class DataSourceConfig {
20 20
 
21 21
     /**
22
+     *  数据源1
23
+     */
24
+    @Primary    //配置该数据源为主数据源
25
+    @Bean(name = "mysql1DataSource")
26
+    @Qualifier(value = "mysql1DataSource")  //spring装配bean的唯一标识
27
+    @ConfigurationProperties(prefix = "mysql1.spring.datasource")   //application.properties配置文件中该数据源的配置前缀
28
+    public DataSource mysql1DataSource(){
29
+        return DataSourceBuilder.create().build();
30
+    }
31
+
32
+    /**
22 33
      *  数据源2
23 34
      */
24 35
 

+ 111 - 0
src/main/java/com/dashitech/config/datasource/MySQL1DataSourceConfig.java

@@ -0,0 +1,111 @@
1
+package com.dashitech.config.datasource;
2
+
3
+import org.springframework.beans.factory.annotation.Autowired;
4
+import org.springframework.beans.factory.annotation.Qualifier;
5
+import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
6
+import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
7
+import org.springframework.context.annotation.Bean;
8
+import org.springframework.context.annotation.Configuration;
9
+import org.springframework.context.annotation.Primary;
10
+import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
11
+import org.springframework.orm.jpa.JpaTransactionManager;
12
+import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
13
+import org.springframework.orm.jpa.vendor.Database;
14
+import org.springframework.transaction.PlatformTransactionManager;
15
+import org.springframework.transaction.annotation.EnableTransactionManagement;
16
+
17
+import javax.persistence.EntityManager;
18
+import javax.sql.DataSource;
19
+import java.util.HashMap;
20
+import java.util.Map;
21
+
22
+/**
23
+ * Created by chi on 2019/9/20.
24
+ */
25
+
26
+@Configuration
27
+@EnableTransactionManagement
28
+@EnableJpaRepositories(entityManagerFactoryRef = "entityManagerFactoryMysql1",   //EntityManagerFactory引用
29
+        transactionManagerRef = "transactionManagerMysql1",      //transactionManager引用
30
+        basePackages = {"com.dashitech.hsms"})                  //设置 基因网orderDiscountDataSource应用到的包
31
+public class MySQL1DataSourceConfig {
32
+
33
+    /**
34
+     * 注入 基因网订单折扣数据源
35
+     */
36
+    @Autowired()
37
+    @Qualifier("mysql1DataSource")
38
+    private DataSource mysql1DataSource;
39
+
40
+    /**
41
+     * 注入JPA配置实体
42
+     */
43
+    @Autowired
44
+    private JpaProperties jpaProperties;
45
+
46
+    /**
47
+     * 通过调用JPA配置实体中的解析方法,解析datasource中各属性的值
48
+     * @param dataSource    数据源
49
+     * @return     本数据源中各参数
50
+     * Map中设值分别为:
51
+     *      hibernate-dialect   方言
52
+     *      hibernate.hbm2ddl.auto  DDL执行策略
53
+     *      hibernate.physical_naming_strategy  命名策略
54
+     *
55
+     *这些和不同类型数据库密切相关的属性设置,不能设置在application.properties中,所以需要再不同的数据源中具体设置,赋值给JpaProperties
56
+     */
57
+    private Map<String,String> getVendorProperties(DataSource dataSource){
58
+        jpaProperties.setDatabase(Database.MYSQL);
59
+        Map<String,String> map = new HashMap<>();
60
+        map.put("hibernate.dialect","org.hibernate.dialect.MySQL5Dialect");
61
+        map.put("hibernate.hbm2ddl.auto","update");
62
+        map.put("hibernate.physical_naming_strategy","org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl");
63
+        jpaProperties.setProperties(map);
64
+        return  jpaProperties.getHibernateProperties(dataSource);
65
+    }
66
+
67
+    /**
68
+     * 配置EntityManagerFactory实体
69
+     * @param builder
70
+     * @return      实体管理工厂
71
+     * packages     扫描@Entity注释的软件包名称
72
+     * persistenceUnit  持久性单元的名称。 如果只建立一个EntityManagerFactory,你可以省略这个,但是如果在同一个应用程序中有多个,你应该给它们不同的名字
73
+     * properties       标准JPA或供应商特定配置的通用属性。 这些属性覆盖构造函数中提供的任何值。
74
+     *
75
+     */
76
+    @Primary
77
+    @Bean(name = "entityManagerFactoryMysql1")
78
+    public LocalContainerEntityManagerFactoryBean entityManagerFactoryMysql1(EntityManagerFactoryBuilder builder){
79
+        return builder
80
+                .dataSource(mysql1DataSource)
81
+                .properties(getVendorProperties(mysql1DataSource))
82
+                .packages(new String[]{"com.dashitech.hsms"})
83
+                .persistenceUnit("mysql1PersistenceUnit")
84
+                .build();
85
+    }
86
+
87
+    /**
88
+     * 配置EntityManager实体
89
+     * @param builder
90
+     * @return      实体管理器
91
+     */
92
+    @Primary
93
+    @Bean(name = "entityManagerMysql1")
94
+    public EntityManager entityManager(EntityManagerFactoryBuilder builder){
95
+        return entityManagerFactoryMysql1(builder).getObject().createEntityManager();
96
+    }
97
+
98
+
99
+    /**
100
+     * 配置事务transactionManager
101
+     * @param builder
102
+     * @return      事务管理器
103
+     */
104
+    @Primary
105
+    @Bean(name = "transactionManagerMysql1")
106
+    public PlatformTransactionManager transactionManagerOrderDiscount(EntityManagerFactoryBuilder builder){
107
+        return  new JpaTransactionManager(entityManagerFactoryMysql1(builder).getObject());
108
+    }
109
+
110
+
111
+}

+ 21 - 0
src/main/java/com/dashitech/hsms/dao/IHsmsCallLogDAO.java

@@ -0,0 +1,21 @@
1
+package com.dashitech.hsms.dao;
2
+
3
+import com.dashitech.hsms.entity.HsmsCallLogEntity;
4
+import org.springframework.data.jpa.repository.JpaRepository;
5
+import org.springframework.data.jpa.repository.Query;
6
+import org.springframework.data.repository.query.Param;
7
+
8
+import java.util.Date;
9
+
10
+public interface IHsmsCallLogDAO extends JpaRepository<HsmsCallLogEntity, String> {
11
+
12
+    @SuppressWarnings("unchecked")
13
+    HsmsCallLogEntity save(HsmsCallLogEntity callLogEntity);
14
+
15
+    @Query(value = " select a from HsmsCallLogEntity a where a.dTMFA=:callerIdNumber and a.dTMFB=:destinationNumber and a.responseTime=:createdTime ")
16
+    HsmsCallLogEntity selectByParams(@Param("callerIdNumber") String callerIdNumber, @Param("destinationNumber") String destinationNumber, @Param("createdTime") Date createdTime);
17
+
18
+    @Query(value = "select hos_id from itsm_system_hospital_config where _key = ?1 and _value =?2 limit 1 ",nativeQuery = true)
19
+    String selectSernelNo(String key,String value);
20
+
21
+}

+ 174 - 0
src/main/java/com/dashitech/hsms/entity/HsmsCallLogEntity.java

@@ -0,0 +1,174 @@
1
+package com.dashitech.hsms.entity;
2
+
3
+import com.dashitech.utils.I18n;
4
+import org.springframework.format.annotation.DateTimeFormat;
5
+
6
+import javax.persistence.*;
7
+import java.io.Serializable;
8
+import java.util.Date;
9
+
10
+@Entity
11
+@Table(name = "itsm_call_log")
12
+public class HsmsCallLogEntity implements Serializable {
13
+
14
+    private static final long serialVersionUID = 1L;
15
+
16
+    @Id
17
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
18
+    @Column(name="id",length = 20)
19
+    private Long id;
20
+
21
+    @I18n("version")
22
+    @Column(name = "version")
23
+    private Integer version;
24
+
25
+    @I18n("来电科室")
26
+    @Column(name = "call_dept")
27
+    private String callDept;
28
+
29
+    @I18n("通道号")
30
+    @Column(name = "phyIDA")
31
+    private String phyIDA;
32
+
33
+    @I18n("主叫号码")
34
+    @Column(name = "DTMFA")
35
+    private String dTMFA;
36
+
37
+    @I18n("被叫号码")
38
+    @Column(name = "DTMFB")
39
+    private String dTMFB;
40
+
41
+    @I18n("录音起始时间")
42
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
43
+    @Column(name = "response_time")
44
+    private Date responseTime;
45
+
46
+    @I18n("录音时长单位秒")
47
+    @Column(name = "long_time")
48
+    private String longTime;
49
+
50
+    @I18n("原文件存放位置")
51
+    @Column(name = "_path")
52
+    private String path;
53
+
54
+    @I18n("呼入呼出 1 呼入 0 呼出")
55
+    @Column(name = "call_type")
56
+    private Integer callType;
57
+
58
+    @I18n("已接未接 1 已接 0 未接")
59
+    @Column(name = "call_state")
60
+    private Integer callState;
61
+
62
+    @I18n("院区id")
63
+    @Column(name = "hos_id")
64
+    private Integer hosId;
65
+
66
+    @I18n("通话流水")
67
+    @Column(name = "call_accept")
68
+    private String callAccept;
69
+
70
+    public Integer getVersion() {
71
+        return version;
72
+    }
73
+
74
+    public void setVersion(Integer version) {
75
+        this.version = version;
76
+    }
77
+
78
+    public String getCallAccept() {
79
+        return callAccept;
80
+    }
81
+
82
+    public void setCallAccept(String callAccept) {
83
+        this.callAccept = callAccept;
84
+    }
85
+
86
+    public Integer getHosId() {
87
+        return hosId;
88
+    }
89
+
90
+    public void setHosId(Integer hosId) {
91
+        this.hosId = hosId;
92
+    }
93
+
94
+    public Long getId() {
95
+        return id;
96
+    }
97
+
98
+    public void setId(Long id) {
99
+        this.id = id;
100
+    }
101
+
102
+    public String getCallDept() {
103
+        return callDept;
104
+    }
105
+
106
+    public void setCallDept(String callDept) {
107
+        this.callDept = callDept;
108
+    }
109
+
110
+    public String getPhyIDA() {
111
+        return phyIDA;
112
+    }
113
+
114
+    public void setPhyIDA(String phyIDA) {
115
+        this.phyIDA = phyIDA;
116
+    }
117
+
118
+    public String getdTMFA() {
119
+        return dTMFA;
120
+    }
121
+
122
+    public void setdTMFA(String dTMFA) {
123
+        this.dTMFA = dTMFA;
124
+    }
125
+
126
+    public String getdTMFB() {
127
+        return dTMFB;
128
+    }
129
+
130
+    public void setdTMFB(String dTMFB) {
131
+        this.dTMFB = dTMFB;
132
+    }
133
+
134
+    public Date getResponseTime() {
135
+        return responseTime;
136
+    }
137
+
138
+    public void setResponseTime(Date responseTime) {
139
+        this.responseTime = responseTime;
140
+    }
141
+
142
+    public String getLongTime() {
143
+        return longTime;
144
+    }
145
+
146
+    public void setLongTime(String longTime) {
147
+        this.longTime = longTime;
148
+    }
149
+
150
+    public String getPath() {
151
+        return path;
152
+    }
153
+
154
+    public void setPath(String path) {
155
+        this.path = path;
156
+    }
157
+
158
+    public Integer getCallType() {
159
+        return callType;
160
+    }
161
+
162
+    public void setCallType(Integer callType) {
163
+        this.callType = callType;
164
+    }
165
+
166
+    public Integer getCallState() {
167
+        return callState;
168
+    }
169
+
170
+    public void setCallState(Integer callState) {
171
+        this.callState = callState;
172
+    }
173
+
174
+}

+ 38 - 9
src/main/resources/application.properties

@@ -1,5 +1,36 @@
1
+
2
+# //TODO 如果只启用1个,把两边数据源,配置成一样就行,避免启动报错
3
+
4
+# //TODO 转运配置
5
+mysql1.spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
6
+mysql1.spring.datasource.driver-class-name=com.mysql.jdbc.Driver
7
+#mysql1.spring.datasource.url=jdbc:mysql://localhost:3306/hsms2_0622?autoReconnect=true&useUnicode=true&characterEncoding=utf8
8
+#mysql1.spring.datasource.url=jdbc:mysql://192.168.3.108:3306/hsms2_0622?autoReconnect=true&useUnicode=true&characterEncoding=utf8
9
+mysql1.spring.datasource.url=jdbc:mysql://192.168.3.111:3306/md2?autoReconnect=true&useUnicode=true&characterEncoding=utf8
10
+mysql1.spring.datasource.username=root
11
+#mysql1.spring.datasource.password=DStech@123
12
+mysql1.spring.datasource.password=100100
13
+
14
+# 下面为连接池的补充设置,应用到上面所有数据源中
15
+# 初始化大小,最小,最大
16
+mysql1.spring.datasource.initialSize=3
17
+mysql1.spring.datasource.minIdle=1
18
+mysql1.spring.datasource.maxActive=150
19
+# 配置获取连接等待超时的时间
20
+mysql1.spring.datasource.maxWait=60000
21
+# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
22
+mysql1.spring.datasource.timeBetweenEvictionRunsMillis=60000
23
+# 配置一个连接在池中最小生存的时间,单位是毫秒
24
+mysql1.spring.datasource.minEvictableIdleTimeMillis=300000
25
+# Oracle请使用select 1 from dual
26
+mysql1.spring.datasource.validationQuery=SELECT 'x'
27
+mysql1.spring.datasource.testWhileIdle=true
28
+mysql1.spring.datasource.testOnBorrow=true
29
+mysql1.spring.datasource.testOnReturn=true
30
+
31
+
32
+# //TODO ITSM配置
1 33
 mysql2.spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
2
-#\u8F6C\u8FD0\u4E1A\u52A1\u5E93\u6570\u636E\u6E90
3 34
 mysql2.spring.datasource.driver-class-name=com.mysql.jdbc.Driver
4 35
 #mysql2.spring.datasource.url=jdbc:mysql://localhost:3306/hsms2_1129?autoReconnect=true&useUnicode=true&characterEncoding=utf8
5 36
 mysql2.spring.datasource.url=jdbc:mysql://192.168.3.111:3306/md2?autoReconnect=true&useUnicode=true&characterEncoding=utf8
@@ -7,19 +38,12 @@ mysql2.spring.datasource.username=root
7 38
 #mysql2.spring.datasource.password=DStech@123
8 39
 mysql2.spring.datasource.password=100100
9 40
 
10
-
11
-# \u4E0B\u9762\u4E3A\u8FDE\u63A5\u6C60\u7684\u8865\u5145\u8BBE\u7F6E\uFF0C\u5E94\u7528\u5230\u4E0A\u9762\u6240\u6709\u6570\u636E\u6E90\u4E2D
12
-# \u521D\u59CB\u5316\u5927\u5C0F\uFF0C\u6700\u5C0F\uFF0C\u6700\u5927
13
-mysql2.spring.datasource.initialSize=5
41
+mysql2.spring.datasource.initialSize=3
14 42
 mysql2.spring.datasource.minIdle=1
15 43
 mysql2.spring.datasource.maxActive=150
16
-# \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4
17 44
 mysql2.spring.datasource.maxWait=60000
18
-# \u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
19 45
 mysql2.spring.datasource.timeBetweenEvictionRunsMillis=60000
20
-# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
21 46
 mysql2.spring.datasource.minEvictableIdleTimeMillis=300000
22
-# Oracle\u8BF7\u4F7F\u7528select 1 from dual
23 47
 mysql2.spring.datasource.validationQuery=SELECT 'x'
24 48
 mysql2.spring.datasource.testWhileIdle=true
25 49
 mysql2.spring.datasource.testOnBorrow=true
@@ -27,9 +51,14 @@ mysql2.spring.datasource.testOnReturn=true
27 51
 
28 52
 #project=HSMS
29 53
 project=ITSM
54
+#project=ALL
55
+#配置呼叫中心以哪个项目为主,单个与project一致即可
56
+project.main=ITSM
30 57
 db.hjzx.record.nginx=/hjzxRecord
31 58
 db.hjzx.record.path.regex=voice
32 59
 
60
+
61
+
33 62
 #spring.redis.host=192.168.245.108
34 63
 spring.redis.host=localhost
35 64
 spring.redis.port=6379

+ 36 - 0
src/main/resources/readme

@@ -0,0 +1,36 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+