Commit 303ce292ac1078a5e0709c7267af85450fcfc43c
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 8 changed files
- platform-common/src/main/java/com/lyms/platform/common/enums/NextVisitTimeEnums.java
- platform-common/src/main/java/com/lyms/platform/common/utils/HttpClientUtil.java
- platform-dal/src/main/java/com/lyms/platform/pojo/NewbornVisit.java
- platform-msg-generate/src/main/java/com/lyms/platform/msg/utils/HelperUtils.java
- platform-msg-generate/src/main/java/com/lyms/platform/msg/worker/TempleteMsgGenerateWorker.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HttpClientUtil.java
platform-common/src/main/java/com/lyms/platform/common/enums/NextVisitTimeEnums.java
View file @
303ce29
... | ... | @@ -54,12 +54,12 @@ |
54 | 54 | private Integer id; |
55 | 55 | private String name; |
56 | 56 | |
57 | - public static NextVisitTimeEnums getName(String id) { | |
57 | + public static String getName(String id) { | |
58 | 58 | if(StringUtils.isNotEmpty(id)) { |
59 | 59 | NextVisitTimeEnums[] values = NextVisitTimeEnums.values(); |
60 | 60 | for (NextVisitTimeEnums value : values) { |
61 | 61 | if (value.getId() == Integer.parseInt(id)) { |
62 | - return value; | |
62 | + return value.getName(); | |
63 | 63 | } |
64 | 64 | } |
65 | 65 | } |
platform-common/src/main/java/com/lyms/platform/common/utils/HttpClientUtil.java
View file @
303ce29
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | * Created by Administrator on 2017-01-18. |
5 | 5 | */ |
6 | 6 | |
7 | +import com.lyms.platform.common.pojo.SyncDataModel; | |
7 | 8 | import org.apache.http.HttpEntity; |
8 | 9 | import org.apache.http.HttpResponse; |
9 | 10 | import org.apache.http.HttpStatus; |
... | ... | @@ -171,6 +172,21 @@ |
171 | 172 | } |
172 | 173 | } |
173 | 174 | return httpStr; |
175 | + } | |
176 | + | |
177 | + public static void main(String[] args) throws Exception { | |
178 | + | |
179 | + Map<String,String> map = new HashMap<String, String>(); | |
180 | + map.put("patientIds","59687f1de4b0b4e56acd1f81"); | |
181 | + map.put("page","1"); | |
182 | + map.put("limit","10"); | |
183 | + long start = System.currentTimeMillis(); | |
184 | + String s = doGet("https://area-lc-api.healthbaby.com.cn:55581/getAppLis", map, "utf-8","3d19960bf3e81e7d816c4f26051c49ba"); | |
185 | + | |
186 | + List<SyncDataModel> list = JsonUtil.toList(s, SyncDataModel.class); | |
187 | + long end = System.currentTimeMillis(); | |
188 | + System.out.print(end -start); | |
189 | + System.out.println(s); | |
174 | 190 | } |
175 | 191 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/NewbornVisit.java
View file @
303ce29
... | ... | @@ -24,8 +24,6 @@ |
24 | 24 | |
25 | 25 | private String hospitalId; |
26 | 26 | |
27 | - private String parentId; | |
28 | - | |
29 | 27 | private String babyId; |
30 | 28 | |
31 | 29 | private String pid; |
... | ... | @@ -192,14 +190,6 @@ |
192 | 190 | |
193 | 191 | public void setHospitalId(String hospitalId) { |
194 | 192 | this.hospitalId = hospitalId; |
195 | - } | |
196 | - | |
197 | - public String getParentId() { | |
198 | - return parentId; | |
199 | - } | |
200 | - | |
201 | - public void setParentId(String parentId) { | |
202 | - this.parentId = parentId; | |
203 | 193 | } |
204 | 194 | |
205 | 195 | public String getBabyId() { |
platform-msg-generate/src/main/java/com/lyms/platform/msg/utils/HelperUtils.java
View file @
303ce29
... | ... | @@ -281,6 +281,17 @@ |
281 | 281 | |
282 | 282 | |
283 | 283 | /** |
284 | + * 是否已经生成过消息 | |
285 | + * @param patientId | |
286 | + * @param tempId | |
287 | + * @return | |
288 | + */ | |
289 | + public static boolean isExistMsg(String patientId,String tempId) | |
290 | + { | |
291 | + return SaveMessageService.isExistMsg(patientId,tempId); | |
292 | + } | |
293 | + | |
294 | + /** | |
284 | 295 | * 儿童服务状态和服务类型条件 |
285 | 296 | * @param serviceType |
286 | 297 | * @param serviceStatus |
platform-msg-generate/src/main/java/com/lyms/platform/msg/worker/TempleteMsgGenerateWorker.java
View file @
303ce29
... | ... | @@ -258,6 +258,11 @@ |
258 | 258 | continue; |
259 | 259 | } |
260 | 260 | |
261 | + if (HelperUtils.isExistMsg(model.getId(), template.getId())) | |
262 | + { | |
263 | + continue; | |
264 | + } | |
265 | + | |
261 | 266 | //短信前缀 |
262 | 267 | String messagePrefix = baseService.getSmsPrefix(config, model.getBuildDoctor()); |
263 | 268 | String messageContent = "【"+messagePrefix+"】"+template.getContent(); |
... | ... | @@ -307,6 +312,11 @@ |
307 | 312 | continue; |
308 | 313 | } |
309 | 314 | |
315 | + if (HelperUtils.isExistMsg(model.getId(),template.getId())) | |
316 | + { | |
317 | + continue; | |
318 | + } | |
319 | + | |
310 | 320 | //短信前缀 |
311 | 321 | String messagePrefix = baseService.getSmsPrefix(config, model.getBuildDoctor()); |
312 | 322 | String messageContent = "【"+messagePrefix+"】"+template.getContent(); |
... | ... | @@ -477,6 +487,12 @@ |
477 | 487 | { |
478 | 488 | continue; |
479 | 489 | } |
490 | + | |
491 | + if (HelperUtils.isExistMsg(pat.getId(),template.getId())) | |
492 | + { | |
493 | + continue; | |
494 | + } | |
495 | + | |
480 | 496 | //短信前缀 |
481 | 497 | String messagePrefix = baseService.getSmsPrefix(config, pat.getBookbuildingDoctor()); |
482 | 498 | String messageContent = "【"+messagePrefix+"】"+template.getContent(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
View file @
303ce29
... | ... | @@ -162,15 +162,17 @@ |
162 | 162 | }else{ |
163 | 163 | |
164 | 164 | List<CheckResponse> result = new ArrayList<CheckResponse>(); |
165 | - if("7".equals(HIS_VERSION)){ | |
166 | - //根据调用接口获取四川南充中心医院的Lis数据 | |
167 | - result.addAll(NczxyyLisService.queryLisCheckList(vcCardNo)); | |
168 | - }else if("6".equals(HIS_VERSION)){ | |
169 | - //调用德州妇幼lis接口 | |
170 | - result.addAll(DzfyHisService.queryLisCheckList(vcCardNo)); | |
171 | - }else{ | |
172 | - result.addAll(queryLisCheckList(vcCardNo,phone,userId)); | |
173 | - } | |
165 | +// if("7".equals(HIS_VERSION)){ | |
166 | +// //根据调用接口获取四川南充中心医院的Lis数据 | |
167 | +// result.addAll(NczxyyLisService.queryLisCheckList(vcCardNo)); | |
168 | +// }else if("6".equals(HIS_VERSION)){ | |
169 | +// //调用德州妇幼lis接口 | |
170 | +// result.addAll(DzfyHisService.queryLisCheckList(vcCardNo)); | |
171 | +// }else{ | |
172 | +// result.addAll(queryLisCheckList(vcCardNo,phone,userId)); | |
173 | +// } | |
174 | + | |
175 | + result.addAll(queryLisCheckList(vcCardNo,phone,userId)); | |
174 | 176 | |
175 | 177 | //result.addAll(queryPacsCheckList(cardNo)); |
176 | 178 | List<String> keyList = new ArrayList<>(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/NewbornServiceImpl.java
View file @
303ce29
... | ... | @@ -84,6 +84,10 @@ |
84 | 84 | newbornVisit.setOperationId(userId.toString()); |
85 | 85 | newbornVisit.setCreated(new Date()); |
86 | 86 | newbornVisit.setYn("1"); |
87 | + BabyModel babyModel = mongoTemplate.findById(newbornVisit.getBabyId(), BabyModel.class); | |
88 | + if(babyModel != null) { | |
89 | + newbornVisit.setPid(babyModel.getPid()); | |
90 | + } | |
87 | 91 | mongoTemplate.save(newbornVisit); |
88 | 92 | return RespBuilder.buildSuccess(newbornVisit.getId()); |
89 | 93 | } else { |
90 | 94 | |
91 | 95 | |
... | ... | @@ -147,13 +151,23 @@ |
147 | 151 | if(StringUtils.isNotBlank(doctor)) { |
148 | 152 | criteria.and("doctor").is(doctor); |
149 | 153 | } |
154 | + if(StringUtils.isNotBlank(key)) { | |
155 | + Criteria c = new Criteria(); | |
156 | + c.orOperator(Criteria.where("mphone").is(key), Criteria.where("name").regex(key), Criteria.where("mcertNo").is(key)).and("yn").ne(0); | |
157 | + List<BabyModel> babyModels = mongoUtil.findField(BabyModel.class, c, "id"); | |
158 | + if(CollectionUtils.isNotEmpty(babyModels)) { | |
159 | + List<String> babyIds = CollectionUtils.getId(babyModels, "id", String.class); | |
160 | + criteria.and("babyId").in(babyIds); | |
161 | + } | |
162 | + } | |
150 | 163 | PageResult pageResult = findMongoPage(NewbornVisit.class, new Query(criteria), page, limit); |
151 | 164 | List<NewbornVisit> newbornVisits = (List<NewbornVisit>) pageResult.getGrid(); |
152 | 165 | List<Map<String, Object>> restMap = new ArrayList<>(); |
153 | 166 | for (NewbornVisit visit : newbornVisits) { |
154 | 167 | Map<String, Object> temp = new HashMap<>(); |
155 | - | |
156 | 168 | temp.put("checkTime", visit.getCheckTime() == null ? null : DateUtil.getyyyy_MM_dd(visit.getCheckTime())); // 复查访视时间 |
169 | + temp.put("id", visit.getId()); | |
170 | + temp.put("pid", visit.getPid()); | |
157 | 171 | String pid = visit.getPid(); |
158 | 172 | if(StringUtils.isNotBlank(pid)) { |
159 | 173 | PersonModel person = mongoTemplate.findById(pid, PersonModel.class); |
160 | 174 | |
161 | 175 | |
162 | 176 | |
163 | 177 | |
... | ... | @@ -163,19 +177,30 @@ |
163 | 177 | temp.put("age", DateUtil.getAge(person.getBirth())); |
164 | 178 | temp.put("phone", person.getPhone()); |
165 | 179 | } |
166 | - Patients patients = mongoTemplate.findById(visit.getParentId(), Patients.class); | |
180 | + } | |
181 | + BabyModel babyModel = mongoTemplate.findById(visit.getBabyId(), BabyModel.class); | |
182 | + if(babyModel != null) { | |
183 | + Patients patients = mongoTemplate.findById(babyModel.getParentId(), Patients.class); | |
167 | 184 | if(patients != null) { |
168 | 185 | int days = DateUtil.daysBetween(patients.getFmDate(), new Date()); |
169 | - temp.put("days", "产后"+days+"天"); | |
186 | + temp.put("days", days); | |
170 | 187 | } |
171 | - temp.put("count", mongoTemplate.count(new Query(criteria), NewbornVisit.class)); | |
172 | - temp.put("benyuan", mongoTemplate.count(new Query(criteria.and("visitHositalId").is(hospitalId)), NewbornVisit.class)); | |
173 | -// Users users = mapper.getUsers(Integer.parseInt(visit.getDoctor())); | |
174 | -// temp.put("doctorName", users == null ? null : users.getName()); | |
175 | 188 | } |
176 | - | |
189 | + List<NewbornVisit> nvs = mongoTemplate.find(new Query(criteria), NewbornVisit.class); | |
190 | + temp.put("count", nvs.size()); | |
191 | + int benyuan = 0; | |
192 | + for (NewbornVisit nv : nvs) { | |
193 | + if(hospitalId.equals(nv.getVisitHospitalId())) { | |
194 | + benyuan++; | |
195 | + } | |
196 | + } | |
197 | + temp.put("benyuan", benyuan); | |
198 | + restMap.add(temp); | |
199 | + String doctorName = mapper.getUserName(visit.getDoctor()); | |
200 | + temp.put("doctorName", doctorName); | |
177 | 201 | } |
178 | - return RespBuilder.buildSuccess(newbornVisits); | |
202 | + pageResult.setGrid(restMap); | |
203 | + return RespBuilder.buildSuccess(pageResult); | |
179 | 204 | } |
180 | 205 | |
181 | 206 | @Override |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HttpClientUtil.java
View file @
303ce29
... | ... | @@ -171,19 +171,5 @@ |
171 | 171 | return json1; |
172 | 172 | } |
173 | 173 | |
174 | - | |
175 | - | |
176 | - | |
177 | - | |
178 | - public static void main(String[] args) throws Exception { | |
179 | - | |
180 | - long start = System.currentTimeMillis(); | |
181 | - String s = doPost("https://area-qhd-api.healthbaby.com.cn:18019/findSyncData", new HashMap<String, String>(), "utf-8"); | |
182 | - | |
183 | - List<SyncDataModel> list = JsonUtil.toList(s, SyncDataModel.class); | |
184 | - long end = System.currentTimeMillis(); | |
185 | - System.out.print(end -start); | |
186 | - System.out.println(s); | |
187 | - } | |
188 | 174 | } |