Commit 0c18e1820a94d3021ba4d5d60ddff31152a3d550
1 parent
3612cdd31e
Exists in
master
and in
1 other branch
结算管理
Showing 18 changed files with 1427 additions and 24 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IChargeRecordDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IHealthChargeDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/ChargeRecordDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/HealthChargeDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/ChargeRecordService.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/HealthChargeService.java
- platform-common/src/main/java/com/lyms/platform/common/enums/PregnancyMethodEnums.java
- platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java
- platform-dal/src/main/java/com/lyms/platform/pojo/ChargeRecordModel.java
- platform-dal/src/main/java/com/lyms/platform/pojo/HealthChargeModel.java
- platform-dal/src/main/java/com/lyms/platform/query/ChargeRecordQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/HealthChargeQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HealthChargeController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/HealthChargeFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/TokenValidateInteceptor.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/HealthChargeRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IChargeRecordDao.java
View file @
0c18e18
1 | +package com.lyms.platform.biz.dal; | |
2 | + | |
3 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
4 | +import com.lyms.platform.pojo.ChargeRecordModel; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +/** | |
9 | + * Created by Administrator on 2019-03-29. | |
10 | + */ | |
11 | +public interface IChargeRecordDao { | |
12 | + public int queryChargeRecordListCount(MongoQuery mongoQuery); | |
13 | + | |
14 | + public List<ChargeRecordModel> queryChargeRecordList(MongoQuery mongoQuery); | |
15 | + | |
16 | + public void addChargeRecord(ChargeRecordModel model); | |
17 | + | |
18 | + public void updateChargeRecord(MongoQuery query, ChargeRecordModel model); | |
19 | + | |
20 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IHealthChargeDao.java
View file @
0c18e18
1 | +package com.lyms.platform.biz.dal; | |
2 | + | |
3 | + | |
4 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
5 | +import com.lyms.platform.pojo.HealthChargeModel; | |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
9 | +/** | |
10 | + * Created by Administrator on 2016/6/21 0021. | |
11 | + */ | |
12 | +public interface IHealthChargeDao { | |
13 | + | |
14 | + int queryHealthChargeListCount(MongoQuery mongoQuery); | |
15 | + | |
16 | + List<HealthChargeModel> queryHealthChargeList(MongoQuery mongoQuery); | |
17 | + | |
18 | + void addHealthCharge(HealthChargeModel model); | |
19 | + | |
20 | + void updateHealthCharge(MongoQuery query, HealthChargeModel model); | |
21 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/ChargeRecordDaoImpl.java
View file @
0c18e18
1 | +package com.lyms.platform.biz.dal.impl; | |
2 | + | |
3 | + | |
4 | +import com.lyms.platform.biz.dal.IChargeRecordDao; | |
5 | +import com.lyms.platform.biz.dal.IHealthChargeDao; | |
6 | +import com.lyms.platform.common.dao.BaseMongoDAOImpl; | |
7 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
8 | +import com.lyms.platform.pojo.ChargeRecordModel; | |
9 | +import com.lyms.platform.pojo.HealthChargeModel; | |
10 | +import org.springframework.stereotype.Repository; | |
11 | + | |
12 | +import java.util.List; | |
13 | + | |
14 | +/** | |
15 | + | |
16 | + */ | |
17 | +@Repository("chargeRecordDao") | |
18 | +public class ChargeRecordDaoImpl extends BaseMongoDAOImpl<ChargeRecordModel> implements IChargeRecordDao { | |
19 | + | |
20 | + @Override | |
21 | + public int queryChargeRecordListCount(MongoQuery mongoQuery) { | |
22 | + return (int)count(mongoQuery.convertToMongoQuery()); | |
23 | + } | |
24 | + | |
25 | + @Override | |
26 | + public List<ChargeRecordModel> queryChargeRecordList(MongoQuery mongoQuery) { | |
27 | + return find(mongoQuery.convertToMongoQuery()); | |
28 | + } | |
29 | + | |
30 | + @Override | |
31 | + public void addChargeRecord(ChargeRecordModel model) { | |
32 | + save(model); | |
33 | + } | |
34 | + | |
35 | + @Override | |
36 | + public void updateChargeRecord(MongoQuery query, ChargeRecordModel model) { | |
37 | + update(query.convertToMongoQuery(), model); | |
38 | + } | |
39 | + | |
40 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/HealthChargeDaoImpl.java
View file @
0c18e18
1 | +package com.lyms.platform.biz.dal.impl; | |
2 | + | |
3 | + | |
4 | +import com.lyms.platform.biz.dal.IHealthChargeDao; | |
5 | +import com.lyms.platform.common.dao.BaseMongoDAOImpl; | |
6 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
7 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
8 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
9 | +import com.lyms.platform.pojo.HealthChargeModel; | |
10 | +import org.springframework.stereotype.Repository; | |
11 | + | |
12 | +import java.util.List; | |
13 | + | |
14 | +/** | |
15 | + | |
16 | + */ | |
17 | +@Repository("healthChargeDao") | |
18 | +public class HealthChargeDaoImpl extends BaseMongoDAOImpl<HealthChargeModel> implements IHealthChargeDao { | |
19 | + | |
20 | + @Override | |
21 | + public int queryHealthChargeListCount(MongoQuery mongoQuery) { | |
22 | + return (int)count(mongoQuery.convertToMongoQuery()); | |
23 | + } | |
24 | + | |
25 | + @Override | |
26 | + public List<HealthChargeModel> queryHealthChargeList(MongoQuery mongoQuery) { | |
27 | + return find(mongoQuery.convertToMongoQuery()); | |
28 | + } | |
29 | + | |
30 | + @Override | |
31 | + public void addHealthCharge(HealthChargeModel model) { | |
32 | + save(model); | |
33 | + } | |
34 | + | |
35 | + @Override | |
36 | + public void updateHealthCharge(MongoQuery query, HealthChargeModel model) { | |
37 | + update(query.convertToMongoQuery(), model); | |
38 | + } | |
39 | + | |
40 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/ChargeRecordService.java
View file @
0c18e18
1 | +package com.lyms.platform.biz.service; | |
2 | + | |
3 | + | |
4 | +import com.lyms.platform.biz.dal.IChargeRecordDao; | |
5 | +import com.lyms.platform.biz.dal.IHealthChargeDao; | |
6 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
7 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
8 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
9 | +import com.lyms.platform.pojo.ChargeRecordModel; | |
10 | +import com.lyms.platform.pojo.HealthChargeModel; | |
11 | +import com.lyms.platform.query.ChargeRecordQuery; | |
12 | +import com.lyms.platform.query.HealthChargeQuery; | |
13 | +import org.apache.commons.lang.StringUtils; | |
14 | +import org.springframework.beans.factory.annotation.Autowired; | |
15 | +import org.springframework.data.domain.Sort; | |
16 | +import org.springframework.stereotype.Service; | |
17 | + | |
18 | +import java.util.List; | |
19 | + | |
20 | + | |
21 | +@Service | |
22 | +public class ChargeRecordService { | |
23 | + | |
24 | + @Autowired | |
25 | + private IChargeRecordDao chargeRecordDao; | |
26 | + | |
27 | + public List<ChargeRecordModel> queryChargeRecordList(ChargeRecordQuery chargeRecordQuery) { | |
28 | + | |
29 | + MongoQuery query = chargeRecordQuery.convertToQuery(); | |
30 | + if (StringUtils.isNotEmpty(chargeRecordQuery.getNeed())) { | |
31 | + chargeRecordQuery.mysqlBuild(chargeRecordDao.queryChargeRecordListCount(chargeRecordQuery.convertToQuery())); | |
32 | + query.start(chargeRecordQuery.getOffset()).end(chargeRecordQuery.getLimit()); | |
33 | + } | |
34 | + return chargeRecordDao.queryChargeRecordList(query.addOrder(Sort.Direction.DESC, "created")); | |
35 | + } | |
36 | + | |
37 | + | |
38 | + public int queryChargeRecordCount(ChargeRecordQuery chargeRecordQuery) { | |
39 | + return chargeRecordDao.queryChargeRecordListCount(chargeRecordQuery.convertToQuery()); | |
40 | + } | |
41 | + | |
42 | + | |
43 | + public void addChargeRecord(ChargeRecordModel model) { | |
44 | + chargeRecordDao.addChargeRecord(model); | |
45 | + } | |
46 | + | |
47 | + public void updateChargeRecord(ChargeRecordModel model) { | |
48 | + chargeRecordDao.updateChargeRecord(new MongoQuery(new MongoCondition("id", model.getId(), MongoOper.IS)), model); | |
49 | + } | |
50 | + | |
51 | + | |
52 | + | |
53 | + | |
54 | + | |
55 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/HealthChargeService.java
View file @
0c18e18
1 | +package com.lyms.platform.biz.service; | |
2 | + | |
3 | + | |
4 | +import com.lyms.platform.biz.dal.IHealthChargeDao; | |
5 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
7 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
8 | +import com.lyms.platform.pojo.CourseModel; | |
9 | +import com.lyms.platform.pojo.HealthChargeModel; | |
10 | +import com.lyms.platform.query.CourseQuery; | |
11 | +import com.lyms.platform.query.HealthChargeQuery; | |
12 | +import org.apache.commons.lang.StringUtils; | |
13 | +import org.springframework.beans.factory.annotation.Autowired; | |
14 | +import org.springframework.data.domain.Sort; | |
15 | +import org.springframework.stereotype.Service; | |
16 | + | |
17 | +import java.util.List; | |
18 | + | |
19 | + | |
20 | +@Service | |
21 | +public class HealthChargeService { | |
22 | + | |
23 | + @Autowired | |
24 | + private IHealthChargeDao healthChargeDao; | |
25 | + | |
26 | + public List<HealthChargeModel> queryHealthChargeList(HealthChargeQuery healthChargeQuery) { | |
27 | + | |
28 | + MongoQuery query = healthChargeQuery.convertToQuery(); | |
29 | + if (StringUtils.isNotEmpty(healthChargeQuery.getNeed())) { | |
30 | + healthChargeQuery.mysqlBuild(healthChargeDao.queryHealthChargeListCount(healthChargeQuery.convertToQuery())); | |
31 | + query.start(healthChargeQuery.getOffset()).end(healthChargeQuery.getLimit()); | |
32 | + } | |
33 | + return healthChargeDao.queryHealthChargeList(query.addOrder(Sort.Direction.DESC, "created")); | |
34 | + } | |
35 | + | |
36 | + | |
37 | + public int queryHealthChargeCount(HealthChargeQuery healthChargeQuery) { | |
38 | + return healthChargeDao.queryHealthChargeListCount(healthChargeQuery.convertToQuery()); | |
39 | + } | |
40 | + | |
41 | + | |
42 | + public void addHealthCharge(HealthChargeModel model) { | |
43 | + healthChargeDao.addHealthCharge(model); | |
44 | + } | |
45 | + | |
46 | + public void updateHealthCharge(HealthChargeModel model) { | |
47 | + healthChargeDao.updateHealthCharge(new MongoQuery(new MongoCondition("id", model.getId(), MongoOper.IS)), model); | |
48 | + } | |
49 | + | |
50 | + public void updateHealthCharges(HealthChargeQuery healthChargeQuery,HealthChargeModel model) { | |
51 | + healthChargeDao.updateHealthCharge(healthChargeQuery.convertToQuery(), model); | |
52 | + } | |
53 | + | |
54 | + | |
55 | + | |
56 | +} |
platform-common/src/main/java/com/lyms/platform/common/enums/PregnancyMethodEnums.java
View file @
0c18e18
platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java
View file @
0c18e18
... | ... | @@ -80,13 +80,13 @@ |
80 | 80 | BabySieveModel("BabySieveModel", 97531049991L), |
81 | 81 | PostpartumRecords("PostpartumRecords", 97521049991L), |
82 | 82 | QuestionModel("QuestionModel", 97521049991L), |
83 | + HealthChargeModel("HealthChargeModel", 97221049991L), | |
84 | + ChargeRecordModel("ChargeRecordModel", 98221049991L), | |
83 | 85 | TemporaryWeightModel("TemporaryWeightModel", 97531049591L), |
84 | 86 | BabyEyeCheck("BabyEyeCheck", 97521039591L); |
85 | 87 | |
86 | - | |
87 | 88 | private String cname; |
88 | 89 | private Long cid; |
89 | - | |
90 | 90 | private SerialIdEnum(String cname, Long cid) { |
91 | 91 | this.cid = cid; |
92 | 92 | this.cname = cname; |
platform-dal/src/main/java/com/lyms/platform/pojo/ChargeRecordModel.java
View file @
0c18e18
1 | +package com.lyms.platform.pojo; | |
2 | + | |
3 | +import com.lyms.platform.beans.SerialIdEnum; | |
4 | +import com.lyms.platform.common.result.BaseModel; | |
5 | +import org.springframework.data.mongodb.core.mapping.Document; | |
6 | + | |
7 | +import java.util.Date; | |
8 | + | |
9 | +/** | |
10 | + * 健康结算管理管理 | |
11 | + */ | |
12 | +@Document(collection = "lyms_charge_record") | |
13 | +public class ChargeRecordModel extends BaseModel { | |
14 | + | |
15 | + private static final long serialVersionUID = SerialIdEnum.ChargeRecordModel.getCid(); | |
16 | + | |
17 | + private String id; | |
18 | + | |
19 | + //医院id | |
20 | + private String hospitalId; | |
21 | + | |
22 | + // 1体重 2 血糖 3 血压 | |
23 | + private Integer healthType; | |
24 | + | |
25 | + private Date startDate; | |
26 | + | |
27 | + private Date endDate; | |
28 | + | |
29 | + private Date created; | |
30 | + | |
31 | + //操作人id | |
32 | + private String operateUserId; | |
33 | + | |
34 | + //结算记录数 | |
35 | + private Integer chargeCount; | |
36 | + | |
37 | + public String getId() { | |
38 | + return id; | |
39 | + } | |
40 | + | |
41 | + public void setId(String id) { | |
42 | + this.id = id; | |
43 | + } | |
44 | + | |
45 | + public String getHospitalId() { | |
46 | + return hospitalId; | |
47 | + } | |
48 | + | |
49 | + public void setHospitalId(String hospitalId) { | |
50 | + this.hospitalId = hospitalId; | |
51 | + } | |
52 | + | |
53 | + public Integer getHealthType() { | |
54 | + return healthType; | |
55 | + } | |
56 | + | |
57 | + public void setHealthType(Integer healthType) { | |
58 | + this.healthType = healthType; | |
59 | + } | |
60 | + | |
61 | + public Date getStartDate() { | |
62 | + return startDate; | |
63 | + } | |
64 | + | |
65 | + public void setStartDate(Date startDate) { | |
66 | + this.startDate = startDate; | |
67 | + } | |
68 | + | |
69 | + public Date getEndDate() { | |
70 | + return endDate; | |
71 | + } | |
72 | + | |
73 | + public void setEndDate(Date endDate) { | |
74 | + this.endDate = endDate; | |
75 | + } | |
76 | + | |
77 | + public Date getCreated() { | |
78 | + return created; | |
79 | + } | |
80 | + | |
81 | + public void setCreated(Date created) { | |
82 | + this.created = created; | |
83 | + } | |
84 | + | |
85 | + public String getOperateUserId() { | |
86 | + return operateUserId; | |
87 | + } | |
88 | + | |
89 | + public void setOperateUserId(String operateUserId) { | |
90 | + this.operateUserId = operateUserId; | |
91 | + } | |
92 | + | |
93 | + public Integer getChargeCount() { | |
94 | + return chargeCount; | |
95 | + } | |
96 | + | |
97 | + public void setChargeCount(Integer chargeCount) { | |
98 | + this.chargeCount = chargeCount; | |
99 | + } | |
100 | +} |
platform-dal/src/main/java/com/lyms/platform/pojo/HealthChargeModel.java
View file @
0c18e18
1 | +package com.lyms.platform.pojo; | |
2 | + | |
3 | +import com.lyms.platform.beans.SerialIdEnum; | |
4 | +import com.lyms.platform.common.result.BaseModel; | |
5 | +import org.springframework.data.mongodb.core.mapping.Document; | |
6 | + | |
7 | +import java.util.Date; | |
8 | + | |
9 | +/** | |
10 | + * 健康打印收费管理 | |
11 | + */ | |
12 | +@Document(collection = "lyms_health_charge") | |
13 | +public class HealthChargeModel extends BaseModel { | |
14 | + | |
15 | + private static final long serialVersionUID = SerialIdEnum.HealthChargeModel.getCid(); | |
16 | + | |
17 | + private String id; | |
18 | + | |
19 | + private Integer yn; | |
20 | + | |
21 | + //医院id | |
22 | + private String hospitalId; | |
23 | + | |
24 | + // 1体重 2 血糖 3 血压 | |
25 | + private Integer healthType; | |
26 | + | |
27 | + //建档id或者临时档案id | |
28 | + private String foreignId; | |
29 | + | |
30 | + //打印报告等级 | |
31 | + private Integer type; | |
32 | + | |
33 | + private Date created; | |
34 | + | |
35 | + private Date modified; | |
36 | + | |
37 | + //档案来源类型 1院内建档 2零时建档 | |
38 | + private Integer source; | |
39 | + | |
40 | + //操作人id | |
41 | + private String operateUserId; | |
42 | + | |
43 | + //结算记录id | |
44 | + private String chargeRecordId; | |
45 | + | |
46 | + //结算状态 1未结算 2结算 | |
47 | + private Integer status; | |
48 | + | |
49 | + public Integer getStatus() { | |
50 | + return status; | |
51 | + } | |
52 | + | |
53 | + public void setStatus(Integer status) { | |
54 | + this.status = status; | |
55 | + } | |
56 | + | |
57 | + public String getChargeRecordId() { | |
58 | + return chargeRecordId; | |
59 | + } | |
60 | + | |
61 | + public void setChargeRecordId(String chargeRecordId) { | |
62 | + this.chargeRecordId = chargeRecordId; | |
63 | + } | |
64 | + | |
65 | + public String getOperateUserId() { | |
66 | + return operateUserId; | |
67 | + } | |
68 | + | |
69 | + public void setOperateUserId(String operateUserId) { | |
70 | + this.operateUserId = operateUserId; | |
71 | + } | |
72 | + | |
73 | + public String getId() { | |
74 | + return id; | |
75 | + } | |
76 | + | |
77 | + public void setId(String id) { | |
78 | + this.id = id; | |
79 | + } | |
80 | + | |
81 | + public Integer getYn() { | |
82 | + return yn; | |
83 | + } | |
84 | + | |
85 | + public void setYn(Integer yn) { | |
86 | + this.yn = yn; | |
87 | + } | |
88 | + | |
89 | + public String getHospitalId() { | |
90 | + return hospitalId; | |
91 | + } | |
92 | + | |
93 | + public void setHospitalId(String hospitalId) { | |
94 | + this.hospitalId = hospitalId; | |
95 | + } | |
96 | + | |
97 | + public Integer getHealthType() { | |
98 | + return healthType; | |
99 | + } | |
100 | + | |
101 | + public void setHealthType(Integer healthType) { | |
102 | + this.healthType = healthType; | |
103 | + } | |
104 | + | |
105 | + public String getForeignId() { | |
106 | + return foreignId; | |
107 | + } | |
108 | + | |
109 | + public void setForeignId(String foreignId) { | |
110 | + this.foreignId = foreignId; | |
111 | + } | |
112 | + | |
113 | + public Integer getType() { | |
114 | + return type; | |
115 | + } | |
116 | + | |
117 | + public void setType(Integer type) { | |
118 | + this.type = type; | |
119 | + } | |
120 | + | |
121 | + public Date getCreated() { | |
122 | + return created; | |
123 | + } | |
124 | + | |
125 | + public void setCreated(Date created) { | |
126 | + this.created = created; | |
127 | + } | |
128 | + | |
129 | + public Date getModified() { | |
130 | + return modified; | |
131 | + } | |
132 | + | |
133 | + public void setModified(Date modified) { | |
134 | + this.modified = modified; | |
135 | + } | |
136 | + | |
137 | + public Integer getSource() { | |
138 | + return source; | |
139 | + } | |
140 | + | |
141 | + public void setSource(Integer source) { | |
142 | + this.source = source; | |
143 | + } | |
144 | +} |
platform-dal/src/main/java/com/lyms/platform/query/ChargeRecordQuery.java
View file @
0c18e18
1 | +package com.lyms.platform.query; | |
2 | + | |
3 | +import com.lyms.platform.common.base.IConvertToNativeQuery; | |
4 | +import com.lyms.platform.common.dao.BaseQuery; | |
5 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
7 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
8 | +import org.springframework.data.mongodb.core.query.Criteria; | |
9 | + | |
10 | +import java.util.Date; | |
11 | + | |
12 | +/** | |
13 | + * Created by Administrator on 2016/6/21 0021. | |
14 | + */ | |
15 | +public class ChargeRecordQuery extends BaseQuery implements IConvertToNativeQuery { | |
16 | + | |
17 | + | |
18 | + private String id; | |
19 | + | |
20 | + private Integer yn; | |
21 | + | |
22 | + //医院id | |
23 | + private String hospitalId; | |
24 | + | |
25 | + // 1体重 2 血糖 3 血压 | |
26 | + private Integer healthType; | |
27 | + | |
28 | + //建档id或者临时档案id | |
29 | + private Integer foreignId; | |
30 | + | |
31 | + //打印报告等级 | |
32 | + private Integer type; | |
33 | + | |
34 | + private String operateUserId; | |
35 | + | |
36 | + //档案来源类型 1院内建档 2零时建档 | |
37 | + private Integer source; | |
38 | + | |
39 | + private Date createdStart; | |
40 | + private Date createdEnd; | |
41 | + | |
42 | + | |
43 | + //结算状态 | |
44 | + private Integer status; | |
45 | + | |
46 | + @Override | |
47 | + public MongoQuery convertToQuery() { | |
48 | + MongoCondition condition = MongoCondition.newInstance(); | |
49 | + | |
50 | + if (null != yn) { | |
51 | + condition = condition.and("yn", yn, MongoOper.IS); | |
52 | + } | |
53 | + if (null != id) { | |
54 | + condition = condition.and("id", id, MongoOper.IS); | |
55 | + } | |
56 | + | |
57 | + if (null != hospitalId) { | |
58 | + condition = condition.and("hospitalId", hospitalId, MongoOper.IS); | |
59 | + } | |
60 | + | |
61 | + if (null != healthType) { | |
62 | + condition = condition.and("healthType", healthType, MongoOper.IS); | |
63 | + } | |
64 | + | |
65 | + if (null != foreignId) { | |
66 | + condition = condition.and("foreignId", foreignId, MongoOper.IS); | |
67 | + } | |
68 | + | |
69 | + if (null != type) { | |
70 | + condition = condition.and("type", type, MongoOper.IS); | |
71 | + } | |
72 | + | |
73 | + if (null != operateUserId) { | |
74 | + condition = condition.and("operateUserId", operateUserId, MongoOper.IS); | |
75 | + } | |
76 | + if (null != status) { | |
77 | + condition = condition.and("status", status, MongoOper.IS); | |
78 | + } | |
79 | + | |
80 | + if (null != source) { | |
81 | + condition = condition.and("source", source, MongoOper.IS); | |
82 | + } | |
83 | + | |
84 | + Criteria c = null; | |
85 | + | |
86 | + if (null != createdStart && createdEnd != null) { | |
87 | + if (null != c) { | |
88 | + c = c.where("created").gte(createdStart).lte(createdEnd); | |
89 | + } else { | |
90 | + c = Criteria.where("created").gte(createdStart).lte(createdEnd); | |
91 | + } | |
92 | + } | |
93 | + | |
94 | + if (null != c) { | |
95 | + condition = condition.andCondition(new MongoCondition(c)); | |
96 | + } | |
97 | + return condition.toMongoQuery(); | |
98 | + } | |
99 | + | |
100 | + | |
101 | + public Integer getStatus() { | |
102 | + return status; | |
103 | + } | |
104 | + | |
105 | + public void setStatus(Integer status) { | |
106 | + this.status = status; | |
107 | + } | |
108 | + | |
109 | + public String getId() { | |
110 | + return id; | |
111 | + } | |
112 | + | |
113 | + public void setId(String id) { | |
114 | + this.id = id; | |
115 | + } | |
116 | + | |
117 | + public Integer getYn() { | |
118 | + return yn; | |
119 | + } | |
120 | + | |
121 | + public void setYn(Integer yn) { | |
122 | + this.yn = yn; | |
123 | + } | |
124 | + | |
125 | + public String getHospitalId() { | |
126 | + return hospitalId; | |
127 | + } | |
128 | + | |
129 | + public void setHospitalId(String hospitalId) { | |
130 | + this.hospitalId = hospitalId; | |
131 | + } | |
132 | + | |
133 | + public Integer getHealthType() { | |
134 | + return healthType; | |
135 | + } | |
136 | + | |
137 | + public void setHealthType(Integer healthType) { | |
138 | + this.healthType = healthType; | |
139 | + } | |
140 | + | |
141 | + public Integer getForeignId() { | |
142 | + return foreignId; | |
143 | + } | |
144 | + | |
145 | + public void setForeignId(Integer foreignId) { | |
146 | + this.foreignId = foreignId; | |
147 | + } | |
148 | + | |
149 | + public Integer getType() { | |
150 | + return type; | |
151 | + } | |
152 | + | |
153 | + public void setType(Integer type) { | |
154 | + this.type = type; | |
155 | + } | |
156 | + | |
157 | + public String getOperateUserId() { | |
158 | + return operateUserId; | |
159 | + } | |
160 | + | |
161 | + public void setOperateUserId(String operateUserId) { | |
162 | + this.operateUserId = operateUserId; | |
163 | + } | |
164 | + | |
165 | + public Integer getSource() { | |
166 | + return source; | |
167 | + } | |
168 | + | |
169 | + public void setSource(Integer source) { | |
170 | + this.source = source; | |
171 | + } | |
172 | + | |
173 | + public Date getCreatedStart() { | |
174 | + return createdStart; | |
175 | + } | |
176 | + | |
177 | + public void setCreatedStart(Date createdStart) { | |
178 | + this.createdStart = createdStart; | |
179 | + } | |
180 | + | |
181 | + public Date getCreatedEnd() { | |
182 | + return createdEnd; | |
183 | + } | |
184 | + | |
185 | + public void setCreatedEnd(Date createdEnd) { | |
186 | + this.createdEnd = createdEnd; | |
187 | + } | |
188 | +} |
platform-dal/src/main/java/com/lyms/platform/query/HealthChargeQuery.java
View file @
0c18e18
1 | +package com.lyms.platform.query; | |
2 | + | |
3 | +import com.lyms.platform.common.base.IConvertToNativeQuery; | |
4 | +import com.lyms.platform.common.dao.BaseQuery; | |
5 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
6 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
7 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
8 | +import org.apache.commons.collections.CollectionUtils; | |
9 | +import org.springframework.data.mongodb.core.query.Criteria; | |
10 | + | |
11 | +import java.util.Date; | |
12 | +import java.util.List; | |
13 | + | |
14 | +/** | |
15 | + * Created by Administrator on 2016/6/21 0021. | |
16 | + */ | |
17 | +public class HealthChargeQuery extends BaseQuery implements IConvertToNativeQuery { | |
18 | + | |
19 | + | |
20 | + private String id; | |
21 | + | |
22 | + private Integer yn; | |
23 | + | |
24 | + //医院id | |
25 | + private String hospitalId; | |
26 | + | |
27 | + // 1体重 2 血糖 3 血压 | |
28 | + private Integer healthType; | |
29 | + | |
30 | + //建档id或者临时档案id | |
31 | + private String foreignId; | |
32 | + | |
33 | + //打印报告等级 | |
34 | + private Integer type; | |
35 | + | |
36 | + private String operateUserId; | |
37 | + | |
38 | + //档案来源类型 1院内建档 2零时建档 | |
39 | + private Integer source; | |
40 | + | |
41 | + private Date createdStart; | |
42 | + private Date createdEnd; | |
43 | + | |
44 | + | |
45 | + //结算记录id | |
46 | + private String chargeRecordId; | |
47 | + //结算状态 | |
48 | + private Integer status; | |
49 | + | |
50 | + @Override | |
51 | + public MongoQuery convertToQuery() { | |
52 | + MongoCondition condition = MongoCondition.newInstance(); | |
53 | + | |
54 | + if (null != yn) { | |
55 | + condition = condition.and("yn", yn, MongoOper.IS); | |
56 | + } | |
57 | + if (null != id) { | |
58 | + condition = condition.and("id", id, MongoOper.IS); | |
59 | + } | |
60 | + | |
61 | + if (null != hospitalId) { | |
62 | + condition = condition.and("hospitalId", hospitalId, MongoOper.IS); | |
63 | + } | |
64 | + if (null != chargeRecordId) { | |
65 | + condition = condition.and("chargeRecordId", hospitalId, MongoOper.IS); | |
66 | + } | |
67 | + | |
68 | + if (null != healthType) { | |
69 | + condition = condition.and("healthType", healthType, MongoOper.IS); | |
70 | + } | |
71 | + | |
72 | + if (null != foreignId) { | |
73 | + condition = condition.and("foreignId", foreignId, MongoOper.IS); | |
74 | + } | |
75 | + | |
76 | + if (null != type) { | |
77 | + condition = condition.and("type", type, MongoOper.IS); | |
78 | + } | |
79 | + | |
80 | + if (null != operateUserId) { | |
81 | + condition = condition.and("operateUserId", operateUserId, MongoOper.IS); | |
82 | + } | |
83 | + if (null != status) { | |
84 | + condition = condition.and("status", status, MongoOper.IS); | |
85 | + } | |
86 | + | |
87 | + if (null != source) { | |
88 | + condition = condition.and("source", source, MongoOper.IS); | |
89 | + } | |
90 | + | |
91 | + Criteria c = null; | |
92 | + | |
93 | + if (null != createdStart && createdEnd != null) { | |
94 | + if (null != c) { | |
95 | + c = c.where("created").gte(createdStart).lte(createdEnd); | |
96 | + } else { | |
97 | + c = Criteria.where("created").gte(createdStart).lte(createdEnd); | |
98 | + } | |
99 | + } | |
100 | + | |
101 | + if (null != c) { | |
102 | + condition = condition.andCondition(new MongoCondition(c)); | |
103 | + } | |
104 | + return condition.toMongoQuery(); | |
105 | + } | |
106 | + | |
107 | + public String getChargeRecordId() { | |
108 | + return chargeRecordId; | |
109 | + } | |
110 | + | |
111 | + public void setChargeRecordId(String chargeRecordId) { | |
112 | + this.chargeRecordId = chargeRecordId; | |
113 | + } | |
114 | + | |
115 | + public Integer getStatus() { | |
116 | + return status; | |
117 | + } | |
118 | + | |
119 | + public void setStatus(Integer status) { | |
120 | + this.status = status; | |
121 | + } | |
122 | + | |
123 | + public String getId() { | |
124 | + return id; | |
125 | + } | |
126 | + | |
127 | + public void setId(String id) { | |
128 | + this.id = id; | |
129 | + } | |
130 | + | |
131 | + public Integer getYn() { | |
132 | + return yn; | |
133 | + } | |
134 | + | |
135 | + public void setYn(Integer yn) { | |
136 | + this.yn = yn; | |
137 | + } | |
138 | + | |
139 | + public String getHospitalId() { | |
140 | + return hospitalId; | |
141 | + } | |
142 | + | |
143 | + public void setHospitalId(String hospitalId) { | |
144 | + this.hospitalId = hospitalId; | |
145 | + } | |
146 | + | |
147 | + public Integer getHealthType() { | |
148 | + return healthType; | |
149 | + } | |
150 | + | |
151 | + public void setHealthType(Integer healthType) { | |
152 | + this.healthType = healthType; | |
153 | + } | |
154 | + | |
155 | + public String getForeignId() { | |
156 | + return foreignId; | |
157 | + } | |
158 | + | |
159 | + public void setForeignId(String foreignId) { | |
160 | + this.foreignId = foreignId; | |
161 | + } | |
162 | + | |
163 | + public Integer getType() { | |
164 | + return type; | |
165 | + } | |
166 | + | |
167 | + public void setType(Integer type) { | |
168 | + this.type = type; | |
169 | + } | |
170 | + | |
171 | + public String getOperateUserId() { | |
172 | + return operateUserId; | |
173 | + } | |
174 | + | |
175 | + public void setOperateUserId(String operateUserId) { | |
176 | + this.operateUserId = operateUserId; | |
177 | + } | |
178 | + | |
179 | + public Integer getSource() { | |
180 | + return source; | |
181 | + } | |
182 | + | |
183 | + public void setSource(Integer source) { | |
184 | + this.source = source; | |
185 | + } | |
186 | + | |
187 | + public Date getCreatedStart() { | |
188 | + return createdStart; | |
189 | + } | |
190 | + | |
191 | + public void setCreatedStart(Date createdStart) { | |
192 | + this.createdStart = createdStart; | |
193 | + } | |
194 | + | |
195 | + public Date getCreatedEnd() { | |
196 | + return createdEnd; | |
197 | + } | |
198 | + | |
199 | + public void setCreatedEnd(Date createdEnd) { | |
200 | + this.createdEnd = createdEnd; | |
201 | + } | |
202 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java
View file @
0c18e18
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | import net.sourceforge.pinyin4j.PinyinHelper; |
5 | 5 | import org.apache.log4j.Logger; |
6 | 6 | |
7 | +import java.util.ArrayList; | |
7 | 8 | import java.util.Comparator; |
8 | 9 | import java.util.List; |
9 | 10 | import java.util.Map; |
... | ... | @@ -17,6 +18,7 @@ |
17 | 18 | private static org.apache.log4j.Logger log = Logger.getLogger("HTTP-INVOKE"); |
18 | 19 | |
19 | 20 | public static void main(String[] args) throws Exception { |
21 | + | |
20 | 22 | } |
21 | 23 | |
22 | 24 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/HealthChargeController.java
View file @
0c18e18
1 | +package com.lyms.platform.operate.web.controller; | |
2 | + | |
3 | + | |
4 | +import com.lyms.platform.common.annotation.TokenRequired; | |
5 | +import com.lyms.platform.common.base.BaseController; | |
6 | +import com.lyms.platform.common.base.LoginContext; | |
7 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
8 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
9 | +import com.lyms.platform.common.result.BaseResponse; | |
10 | +import com.lyms.platform.common.utils.StringUtils; | |
11 | +import com.lyms.platform.operate.web.facade.AutoMatchFacade; | |
12 | +import com.lyms.platform.operate.web.facade.BabyCheckFacade; | |
13 | +import com.lyms.platform.operate.web.facade.HealthChargeFacade; | |
14 | +import com.lyms.platform.operate.web.request.BabyCheckRequest; | |
15 | +import com.lyms.platform.operate.web.request.HealthChargeRequest; | |
16 | +import com.lyms.platform.operate.web.request.RiskPatientsCountRequest; | |
17 | +import com.lyms.platform.permission.service.CouponService; | |
18 | +import org.springframework.beans.factory.annotation.Autowired; | |
19 | +import org.springframework.stereotype.Controller; | |
20 | +import org.springframework.web.bind.annotation.*; | |
21 | + | |
22 | +import javax.servlet.http.HttpServletRequest; | |
23 | +import javax.servlet.http.HttpServletResponse; | |
24 | +import javax.validation.Valid; | |
25 | + | |
26 | + | |
27 | +/** | |
28 | + * 健康管理中的收费管理 | |
29 | + */ | |
30 | +@Controller | |
31 | +public class HealthChargeController extends BaseController{ | |
32 | + | |
33 | + | |
34 | + @Autowired | |
35 | + private HealthChargeFacade healthChargeFacade; | |
36 | + | |
37 | + | |
38 | + /** | |
39 | + * 添加 | |
40 | + * @param request | |
41 | + * @return | |
42 | + */ | |
43 | + @RequestMapping(method = RequestMethod.POST, value = "/addHealthCharge") | |
44 | + @ResponseBody | |
45 | + @TokenRequired | |
46 | + public BaseResponse addHealthCharge(@Valid @RequestBody HealthChargeRequest request, | |
47 | + HttpServletRequest httpServletRequest) { | |
48 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
49 | + | |
50 | + BaseResponse baseResponse = healthChargeFacade.addHealthCharge(request,loginState.getId()); | |
51 | + return baseResponse; | |
52 | + } | |
53 | + | |
54 | + /** | |
55 | + * 列表 | |
56 | + * @param healthType | |
57 | + * @param hospitalId | |
58 | + * @param httpServletRequest | |
59 | + * @return | |
60 | + */ | |
61 | + @RequestMapping(method = RequestMethod.GET, value = "/getHealthCharges",produces = {"application/xml; charset=UTF-8"}) | |
62 | + @ResponseBody | |
63 | + @TokenRequired | |
64 | + public BaseResponse getHealthCharges(@RequestParam(required = true) Integer healthType, | |
65 | + @RequestParam(required = false) String hospitalId, | |
66 | + @RequestParam(required = false) String time, | |
67 | + @RequestParam(required = false) Integer source, | |
68 | + @RequestParam(required = false) Integer status, | |
69 | + @RequestParam(required = false) Integer type, | |
70 | + @RequestParam(required = true) Integer page, | |
71 | + @RequestParam(required = true) Integer limit, | |
72 | + HttpServletRequest httpServletRequest) { | |
73 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
74 | + | |
75 | + BaseResponse baseResponse =healthChargeFacade.getHealthCharges(healthType, hospitalId, time, source, status, type, page, limit, loginState.getId()); | |
76 | + return baseResponse; | |
77 | + } | |
78 | + | |
79 | + /** | |
80 | + *结算 | |
81 | + * @param healthType | |
82 | + * @param hospitalId | |
83 | + * @param httpServletRequest | |
84 | + * @return | |
85 | + */ | |
86 | + @RequestMapping(method = RequestMethod.GET, value = "/setHealthCharged") | |
87 | + @ResponseBody | |
88 | + @TokenRequired | |
89 | + public BaseResponse setHealthCharged(@RequestParam(required = true) Integer healthType, | |
90 | + @RequestParam(required = false) String hospitalId, | |
91 | + @RequestParam(required = false) String time, | |
92 | + @RequestParam(required = false) Integer source, | |
93 | + @RequestParam(required = false) Integer status, | |
94 | + @RequestParam(required = false) Integer type, | |
95 | + HttpServletRequest httpServletRequest) { | |
96 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
97 | + | |
98 | + BaseResponse baseResponse =healthChargeFacade.setHealthCharged(healthType, hospitalId, time, source, status, type, loginState.getId()); | |
99 | + return baseResponse; | |
100 | + } | |
101 | + | |
102 | + | |
103 | + /** | |
104 | + * 结算列表 | |
105 | + * @param healthType | |
106 | + * @param hospitalId | |
107 | + * @param time | |
108 | + * @param httpServletRequest | |
109 | + * @return | |
110 | + */ | |
111 | + @RequestMapping(method = RequestMethod.GET, value = "/getChargeRecords") | |
112 | + @ResponseBody | |
113 | + @TokenRequired | |
114 | + public BaseResponse getChargeRecords(@RequestParam(required = true) Integer healthType, | |
115 | + @RequestParam(required = false) String hospitalId, | |
116 | + @RequestParam(required = false) String time, | |
117 | + @RequestParam(required = false) Integer page, | |
118 | + @RequestParam(required = false) Integer limit, | |
119 | + @RequestParam(required = false) String doctorId, | |
120 | + HttpServletRequest httpServletRequest) { | |
121 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
122 | + | |
123 | + BaseResponse baseResponse = healthChargeFacade.getChargeRecords(healthType, hospitalId, time, doctorId, page, limit, loginState.getId()); | |
124 | + return baseResponse; | |
125 | + } | |
126 | + | |
127 | + /** | |
128 | + * 导出 | |
129 | + * @param id | |
130 | + * @param request | |
131 | + * @param response | |
132 | + */ | |
133 | + @RequestMapping(method = RequestMethod.GET, value = "/exportChargeRecords") | |
134 | + @TokenRequired | |
135 | + public void exportChargeRecords(@RequestParam(required = true) String id, | |
136 | + HttpServletRequest request, | |
137 | + HttpServletResponse response) { | |
138 | + healthChargeFacade.exportChargeRecords(id | |
139 | + , response); | |
140 | + } | |
141 | + | |
142 | + | |
143 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/HealthChargeFacade.java
View file @
0c18e18
1 | +package com.lyms.platform.operate.web.facade; | |
2 | + | |
3 | +import com.lyms.platform.biz.service.ChargeRecordService; | |
4 | +import com.lyms.platform.biz.service.HealthChargeService; | |
5 | +import com.lyms.platform.biz.service.PatientsService; | |
6 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
7 | +import com.lyms.platform.common.enums.YnEnums; | |
8 | +import com.lyms.platform.common.result.BaseListResponse; | |
9 | +import com.lyms.platform.common.result.BaseResponse; | |
10 | +import com.lyms.platform.common.utils.DateUtil; | |
11 | +import com.lyms.platform.common.utils.ExcelUtil; | |
12 | +import com.lyms.platform.common.utils.StringUtils; | |
13 | +import com.lyms.platform.operate.web.request.HealthChargeRequest; | |
14 | +import com.lyms.platform.permission.service.UsersService; | |
15 | +import com.lyms.platform.pojo.ChargeRecordModel; | |
16 | +import com.lyms.platform.pojo.HealthChargeModel; | |
17 | +import com.lyms.platform.pojo.Patients; | |
18 | +import com.lyms.platform.query.ChargeRecordQuery; | |
19 | +import com.lyms.platform.query.HealthChargeQuery; | |
20 | +import org.apache.commons.collections.CollectionUtils; | |
21 | +import org.springframework.beans.factory.annotation.Autowired; | |
22 | +import org.springframework.data.mongodb.core.MongoTemplate; | |
23 | +import org.springframework.stereotype.Component; | |
24 | + | |
25 | +import javax.servlet.http.HttpServletResponse; | |
26 | +import java.io.OutputStream; | |
27 | +import java.util.*; | |
28 | + | |
29 | +/** | |
30 | + * Created by Administrator on 2019-03-28. | |
31 | + */ | |
32 | +@Component | |
33 | +public class HealthChargeFacade { | |
34 | + | |
35 | + @Autowired | |
36 | + private HealthChargeService healthChargeService; | |
37 | + | |
38 | + | |
39 | + @Autowired | |
40 | + private ChargeRecordService chargeRecordService; | |
41 | + | |
42 | + @Autowired | |
43 | + private PatientsService patientsService; | |
44 | + | |
45 | + @Autowired | |
46 | + private UsersService usersService; | |
47 | + | |
48 | + /** | |
49 | + * 打印体重、血糖、血压调用接口 | |
50 | + * @param hospitalId 医院id | |
51 | + * @param healthType 打印类型 1体重 2 血糖 3 血压 | |
52 | + * @param foreignId 档案id (院内建档或者临时档案id) | |
53 | + * @param type 打印报告类别 1普通报告 2高危报告 | |
54 | + * @param source 档案来源类型 1院内建档 2零时建档 | |
55 | + * @param userId 当前登陆用户id | |
56 | + * @return | |
57 | + */ | |
58 | + public BaseResponse addHealthCharge(String hospitalId,Integer healthType,String foreignId,Integer type,Integer source, Integer userId) | |
59 | + { | |
60 | + HealthChargeRequest request = new HealthChargeRequest(); | |
61 | + request.setHospitalId(hospitalId); | |
62 | + request.setHealthType(healthType); | |
63 | + request.setForeignId(foreignId); | |
64 | + request.setType(type); | |
65 | + request.setSource(source); | |
66 | + return addHealthCharge(request, userId); | |
67 | + } | |
68 | + | |
69 | + | |
70 | + /** | |
71 | + * 添加 | |
72 | + * @param request | |
73 | + * @param userId | |
74 | + * @return | |
75 | + */ | |
76 | + public BaseResponse addHealthCharge(HealthChargeRequest request, Integer userId) { | |
77 | + | |
78 | + HealthChargeQuery healthChargeQuery = new HealthChargeQuery(); | |
79 | + healthChargeQuery.setForeignId(request.getForeignId()); | |
80 | + healthChargeQuery.setHealthType(request.getHealthType()); | |
81 | + healthChargeQuery.setSource(request.getSource()); | |
82 | + List<HealthChargeModel> list = healthChargeService.queryHealthChargeList(healthChargeQuery); | |
83 | + | |
84 | + boolean isSave = false; | |
85 | + if (CollectionUtils.isNotEmpty(list)) | |
86 | + { | |
87 | + HealthChargeModel model = list.get(0); | |
88 | + | |
89 | + if (DateUtil.getyyyy_MM_dd(new Date()).equals(DateUtil.getyyyy_MM_dd(model.getCreated()))) | |
90 | + { | |
91 | + model.setModified(new Date()); | |
92 | + healthChargeService.updateHealthCharge(model); | |
93 | + } | |
94 | + else | |
95 | + { | |
96 | + isSave = true; | |
97 | + } | |
98 | + } | |
99 | + else | |
100 | + { | |
101 | + isSave = true; | |
102 | + } | |
103 | + if (isSave) | |
104 | + { | |
105 | + HealthChargeModel model = request.convertToDataModel(); | |
106 | + model.setStatus(1); | |
107 | + model.setOperateUserId(String.valueOf(userId)); | |
108 | + model.setCreated(new Date()); | |
109 | + model.setModified(new Date()); | |
110 | + model.setYn(YnEnums.YES.getId()); | |
111 | + healthChargeService.addHealthCharge(model); | |
112 | + } | |
113 | + | |
114 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
115 | + } | |
116 | + | |
117 | + public BaseResponse getHealthCharges(Integer healthType, String hospitalId,String time,Integer source,Integer status,Integer type,Integer page,Integer limit,Integer userId) | |
118 | + { | |
119 | + | |
120 | + List<Map> listData = new ArrayList<>(); | |
121 | + HealthChargeQuery healthChargeQuery = new HealthChargeQuery(); | |
122 | + healthChargeQuery.setPage(page); | |
123 | + healthChargeQuery.setLimit(limit); | |
124 | + healthChargeQuery.setNeed("true"); | |
125 | + healthChargeQuery.setHealthType(healthType); | |
126 | + healthChargeQuery.setYn(YnEnums.YES.getId()); | |
127 | + healthChargeQuery.setHospitalId(hospitalId); | |
128 | + healthChargeQuery.setSource(source); | |
129 | + healthChargeQuery.setStatus(status); | |
130 | + healthChargeQuery.setType(type); | |
131 | + if (StringUtils.isNotEmpty(time)) { | |
132 | + String[] dates = time.split(" - "); | |
133 | + healthChargeQuery.setCreatedStart(DateUtil.parseYMD(dates[0])); | |
134 | + if (dates.length == 2) { | |
135 | + healthChargeQuery.setCreatedEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59")); | |
136 | + } | |
137 | + } | |
138 | + | |
139 | + List<HealthChargeModel> list = healthChargeService.queryHealthChargeList(healthChargeQuery); | |
140 | + | |
141 | + if (CollectionUtils.isNotEmpty(list)) | |
142 | + { | |
143 | + | |
144 | + for (HealthChargeModel model : list) | |
145 | + { | |
146 | + Map map = getData(model); | |
147 | + if (map == null) | |
148 | + { | |
149 | + continue; | |
150 | + } | |
151 | + listData.add(map); | |
152 | + } | |
153 | + } | |
154 | + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(listData).setPageInfo(healthChargeQuery.getPageInfo()); | |
155 | + } | |
156 | + | |
157 | + private Map getData(HealthChargeModel model) | |
158 | + { | |
159 | + Map map = new HashMap(); | |
160 | + | |
161 | + if (model.getSource() == 1) | |
162 | + { | |
163 | + Patients patients = patientsService.findOnePatientById(model.getForeignId()); | |
164 | + if (patients == null) | |
165 | + { | |
166 | + return null; | |
167 | + } | |
168 | + map.put("userName", patients.getUsername()); | |
169 | + map.put("age",DateUtil.getAge(patients.getBirth(), model.getCreated())); | |
170 | + map.put("week",patients.getType() == 3 ? "已分娩": DateUtil.getWeekDesc(patients.getLastMenses(),model.getCreated())); | |
171 | + } | |
172 | + else | |
173 | + { | |
174 | + | |
175 | + } | |
176 | + | |
177 | + | |
178 | + map.put("type",model.getType() == 1 ? "标准报告" : "高危报告"); | |
179 | + map.put("source",model.getSource() == 1 ? "院内" : "临时"); | |
180 | + map.put("time", DateUtil.getyyyy_MM_dd(model.getCreated())); | |
181 | + return map; | |
182 | + } | |
183 | + | |
184 | + public BaseResponse setHealthCharged(Integer healthType, String hospitalId, String time, Integer source, Integer status, Integer type, Integer userId) | |
185 | + { | |
186 | + | |
187 | + ChargeRecordModel recordModel = new ChargeRecordModel(); | |
188 | + | |
189 | + HealthChargeQuery healthChargeQuery = new HealthChargeQuery(); | |
190 | + healthChargeQuery.setHealthType(healthType); | |
191 | + healthChargeQuery.setYn(YnEnums.YES.getId()); | |
192 | + healthChargeQuery.setHospitalId(hospitalId); | |
193 | + healthChargeQuery.setSource(source); | |
194 | + healthChargeQuery.setStatus(status); | |
195 | + healthChargeQuery.setType(type); | |
196 | + if (StringUtils.isNotEmpty(time)) | |
197 | + { | |
198 | + String[] dates = time.split(" - "); | |
199 | + healthChargeQuery.setCreatedStart(DateUtil.parseYMD(dates[0])); | |
200 | + if (dates.length == 2) | |
201 | + { | |
202 | + healthChargeQuery.setCreatedEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59")); | |
203 | + } | |
204 | + | |
205 | + recordModel.setStartDate(DateUtil.parseYMD(dates[0])); | |
206 | + recordModel.setEndDate(DateUtil.parseYMD(dates[1])); | |
207 | + } | |
208 | + | |
209 | + int chargeCount = healthChargeService.queryHealthChargeCount(healthChargeQuery); | |
210 | + | |
211 | + recordModel.setOperateUserId(String.valueOf(userId)); | |
212 | + recordModel.setHealthType(healthType); | |
213 | + recordModel.setCreated(new Date()); | |
214 | + recordModel.setHospitalId(hospitalId); | |
215 | + recordModel.setChargeCount(chargeCount); | |
216 | + recordModel.setCreated(new Date()); | |
217 | + | |
218 | + chargeRecordService.addChargeRecord(recordModel); | |
219 | + | |
220 | + | |
221 | + | |
222 | + HealthChargeModel model = new HealthChargeModel(); | |
223 | + model.setChargeRecordId(recordModel.getId()); | |
224 | + model.setStatus(2); | |
225 | + healthChargeService.updateHealthCharges(healthChargeQuery,model); | |
226 | + | |
227 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
228 | + } | |
229 | + | |
230 | + public BaseResponse getChargeRecords(Integer healthType, String hospitalId, String time, String doctorId, Integer page, Integer limit, Integer userId) | |
231 | + { | |
232 | + List<Map> listData = new ArrayList<>(); | |
233 | + ChargeRecordQuery chargeRecordQuery = new ChargeRecordQuery(); | |
234 | + chargeRecordQuery.setHealthType(healthType); | |
235 | + chargeRecordQuery.setHospitalId(hospitalId); | |
236 | + chargeRecordQuery.setOperateUserId(doctorId); | |
237 | + chargeRecordQuery.setPage(page); | |
238 | + chargeRecordQuery.setLimit(limit); | |
239 | + chargeRecordQuery.setNeed("true"); | |
240 | + if (StringUtils.isNotEmpty(time)) | |
241 | + { | |
242 | + String[] dates = time.split(" - "); | |
243 | + chargeRecordQuery.setCreatedStart(DateUtil.parseYMD(dates[0])); | |
244 | + if (dates.length == 2) | |
245 | + { | |
246 | + chargeRecordQuery.setCreatedEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59")); | |
247 | + } | |
248 | + } | |
249 | + List<ChargeRecordModel> list = chargeRecordService.queryChargeRecordList(chargeRecordQuery); | |
250 | + if (CollectionUtils.isNotEmpty(list)) | |
251 | + { | |
252 | + for (ChargeRecordModel model : list) | |
253 | + { | |
254 | + Map map = new HashMap(); | |
255 | + map.put("id",model.getId()); | |
256 | + map.put("startDate",DateUtil.getyyyy_MM_dd(model.getStartDate())); | |
257 | + map.put("endDate",DateUtil.getyyyy_MM_dd(model.getEndDate())); | |
258 | + map.put("chargeCount",model.getChargeCount()); | |
259 | + map.put("doctorName",usersService.getUsers(Integer.parseInt(model.getOperateUserId())).getName()); | |
260 | + map.put("created",DateUtil.getyyyy_MM_dd(model.getCreated())); | |
261 | + listData.add(map); | |
262 | + } | |
263 | + } | |
264 | + return new BaseListResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(listData).setPageInfo(chargeRecordQuery.getPageInfo()); | |
265 | + } | |
266 | + | |
267 | + /** | |
268 | + * 导出 | |
269 | + * @param id | |
270 | + * @param response | |
271 | + */ | |
272 | + public void exportChargeRecords(String id, HttpServletResponse response) | |
273 | + { | |
274 | + | |
275 | + try { | |
276 | + List<Map<String, Object>> listData = new ArrayList<>(); | |
277 | + HealthChargeQuery healthChargeQuery = new HealthChargeQuery(); | |
278 | + healthChargeQuery.setChargeRecordId(id); | |
279 | + List<HealthChargeModel> list = healthChargeService.queryHealthChargeList(healthChargeQuery); | |
280 | + if (CollectionUtils.isNotEmpty(list)) | |
281 | + { | |
282 | + | |
283 | + for (HealthChargeModel model : list) | |
284 | + { | |
285 | + Map map = getData(model); | |
286 | + listData.add(map); | |
287 | + } | |
288 | + } | |
289 | + | |
290 | + OutputStream out = response.getOutputStream(); | |
291 | + Map<String, String> cnames = new LinkedHashMap<>(); | |
292 | + cnames.put("userName", "姓名"); | |
293 | + cnames.put("age", "年龄"); | |
294 | + cnames.put("week", "孕周"); | |
295 | + cnames.put("type", "报告类型"); | |
296 | + cnames.put("source", "数据来源"); | |
297 | + cnames.put("time", "结款时间"); | |
298 | + response.setContentType("application/octet-stream"); | |
299 | + response.setCharacterEncoding("UTF-8"); | |
300 | + response.setHeader("Content-Disposition", "attachment;fileName=data.xls"); | |
301 | + ExcelUtil.toExcel(out, listData, cnames); | |
302 | + } | |
303 | + catch (Exception e) | |
304 | + { | |
305 | + e.printStackTrace(); | |
306 | + } | |
307 | + } | |
308 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/TokenValidateInteceptor.java
View file @
0c18e18
... | ... | @@ -5,10 +5,8 @@ |
5 | 5 | import com.lyms.platform.common.base.BaseController; |
6 | 6 | import com.lyms.platform.common.base.ContextHolder; |
7 | 7 | import com.lyms.platform.common.base.LoginContext; |
8 | -import com.lyms.platform.common.exception.ForbiddenException; | |
9 | 8 | import com.lyms.platform.common.exception.TokenException; |
10 | 9 | import com.lyms.platform.common.utils.LogUtil; |
11 | -import com.lyms.platform.common.utils.PropertiesUtils; | |
12 | 10 | import com.lyms.platform.operate.web.session.SessionProvider; |
13 | 11 | import com.lyms.platform.permission.service.UsersService; |
14 | 12 | import org.apache.commons.lang.StringUtils; |
... | ... | @@ -32,9 +30,6 @@ |
32 | 30 | */ |
33 | 31 | public class TokenValidateInteceptor extends HandlerInterceptorAdapter { |
34 | 32 | |
35 | - public static final String XT_VERSION = PropertiesUtils.getPropertyValue("xt_version"); | |
36 | - | |
37 | - | |
38 | 33 | @Autowired |
39 | 34 | private SessionProvider sessionProvider; |
40 | 35 | |
... | ... | @@ -44,20 +39,6 @@ |
44 | 39 | |
45 | 40 | @Override |
46 | 41 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
47 | - | |
48 | - if (XT_VERSION != null && XT_VERSION.equals("xt_version")) | |
49 | - { | |
50 | - String referer = request.getHeader("Referer"); | |
51 | - String url = request.getRequestURL().toString(); | |
52 | - if (StringUtils.isNotEmpty(referer) && !referer.contains("area-xtrm.healthbaby.com.cn")) | |
53 | - { | |
54 | - throw new ForbiddenException(); | |
55 | - } | |
56 | - else if (StringUtils.isNotEmpty(url) && !url.contains("area-xtrm-api.healthbaby.com.cn")) | |
57 | - { | |
58 | - throw new ForbiddenException(); | |
59 | - } | |
60 | - } | |
61 | 42 | |
62 | 43 | if (!isSiteController(handler)) |
63 | 44 | return true; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/HealthChargeRequest.java
View file @
0c18e18
1 | +package com.lyms.platform.operate.web.request; | |
2 | + | |
3 | +import com.lyms.platform.common.base.IBasicRequestConvert; | |
4 | +import com.lyms.platform.pojo.HealthChargeModel; | |
5 | + | |
6 | + | |
7 | + | |
8 | +/** | |
9 | + */ | |
10 | +public class HealthChargeRequest implements IBasicRequestConvert<HealthChargeModel> { | |
11 | + | |
12 | + | |
13 | + private String id; | |
14 | + | |
15 | + private String yn; | |
16 | + | |
17 | + //医院id | |
18 | + private String hospitalId; | |
19 | + | |
20 | + // 1体重 2 血糖 3 血压 | |
21 | + private Integer healthType; | |
22 | + | |
23 | + //建档id或者临时档案id | |
24 | + private String foreignId; | |
25 | + | |
26 | + //打印报告类别 1普通报告 2高危报告 | |
27 | + private Integer type; | |
28 | + | |
29 | + | |
30 | + //档案来源类型 1院内建档 2零时建档 | |
31 | + private Integer source; | |
32 | + | |
33 | + @Override | |
34 | + public HealthChargeModel convertToDataModel() { | |
35 | + HealthChargeModel model = new HealthChargeModel(); | |
36 | + model.setId(id); | |
37 | + model.setHospitalId(hospitalId); | |
38 | + model.setHealthType(healthType); | |
39 | + model.setForeignId(foreignId); | |
40 | + model.setType(type); | |
41 | + model.setSource(source); | |
42 | + return model; | |
43 | + } | |
44 | + | |
45 | + public String getId() { | |
46 | + return id; | |
47 | + } | |
48 | + | |
49 | + public void setId(String id) { | |
50 | + this.id = id; | |
51 | + } | |
52 | + | |
53 | + public String getYn() { | |
54 | + return yn; | |
55 | + } | |
56 | + | |
57 | + public void setYn(String yn) { | |
58 | + this.yn = yn; | |
59 | + } | |
60 | + | |
61 | + public String getHospitalId() { | |
62 | + return hospitalId; | |
63 | + } | |
64 | + | |
65 | + public void setHospitalId(String hospitalId) { | |
66 | + this.hospitalId = hospitalId; | |
67 | + } | |
68 | + | |
69 | + public Integer getHealthType() { | |
70 | + return healthType; | |
71 | + } | |
72 | + | |
73 | + public void setHealthType(Integer healthType) { | |
74 | + this.healthType = healthType; | |
75 | + } | |
76 | + | |
77 | + public String getForeignId() { | |
78 | + return foreignId; | |
79 | + } | |
80 | + | |
81 | + public void setForeignId(String foreignId) { | |
82 | + this.foreignId = foreignId; | |
83 | + } | |
84 | + | |
85 | + | |
86 | + public Integer getSource() { | |
87 | + return source; | |
88 | + } | |
89 | + | |
90 | + public void setSource(Integer source) { | |
91 | + this.source = source; | |
92 | + } | |
93 | + | |
94 | + public Integer getType() { | |
95 | + return type; | |
96 | + } | |
97 | + | |
98 | + public void setType(Integer type) { | |
99 | + this.type = type; | |
100 | + } | |
101 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java
View file @
0c18e18
... | ... | @@ -329,7 +329,7 @@ |
329 | 329 | @Override |
330 | 330 | public Map<String, Object> getAppInfo(String parentId) { |
331 | 331 | List<BloodPressure> bloodPressure = mongoTemplate.find(Query.query(Criteria.where("pid").is(parentId)), BloodPressure.class); |
332 | - List<Map<String, Object>> restList = new ArrayList<>(); | |
332 | + List<Map<String, Object>> restList = new LinkedList<>(); | |
333 | 333 | int count = 0; |
334 | 334 | if (CollectionUtils.isNotEmpty(bloodPressure)) { |
335 | 335 | for (BloodPressure b : bloodPressure) { |
... | ... | @@ -349,7 +349,7 @@ |
349 | 349 | } |
350 | 350 | } |
351 | 351 | } |
352 | - CollectionUtils.sortListByMapKeyWithDate(restList, "createTime"); | |
352 | +// CollectionUtils.sortListByMapKeyWithDate(restList, "createTime"); | |
353 | 353 | Map<String, Object> map = new HashMap<>(); |
354 | 354 | map.put("restList", restList); |
355 | 355 | map.put("excetionCount", count); |