Commit 7eb87a7095f62d126568cc05aeafdccab6223ba3
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 4 changed files
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
- platform-operate-api/src/main/resources/fxpjbg.docx
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java
View file @
7eb87a7
... | ... | @@ -38,11 +38,9 @@ |
38 | 38 | import org.springframework.context.support.ClassPathXmlApplicationContext; |
39 | 39 | |
40 | 40 | import org.springframework.data.mongodb.core.MongoTemplate; |
41 | -import org.springframework.data.mongodb.core.query.BasicQuery; | |
42 | 41 | import org.springframework.data.mongodb.core.query.Criteria; |
43 | 42 | import org.springframework.data.mongodb.core.query.Query; |
44 | 43 | import org.springframework.data.mongodb.core.query.Update; |
45 | -import sun.awt.windows.WEmbeddedFrame; | |
46 | 44 | |
47 | 45 | public class BasicConfigServiceTest { |
48 | 46 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java
View file @
7eb87a7
... | ... | @@ -8,10 +8,12 @@ |
8 | 8 | import com.lyms.platform.common.result.BaseListResponse; |
9 | 9 | import com.lyms.platform.common.result.BaseObjectResponse; |
10 | 10 | import com.lyms.platform.common.result.BaseResponse; |
11 | +import com.lyms.platform.common.utils.DateUtil; | |
11 | 12 | import com.lyms.platform.common.utils.StringUtils; |
12 | 13 | import com.lyms.platform.operate.web.facade.AntenatalExaminationFacade; |
13 | 14 | import com.lyms.platform.operate.web.facade.MatdeliverFollowFacade; |
14 | 15 | import com.lyms.platform.operate.web.facade.ViewFacade; |
16 | +import com.lyms.platform.operate.web.utils.CommonsHelper; | |
15 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
16 | 18 | import org.springframework.stereotype.Controller; |
17 | 19 | import org.springframework.web.bind.annotation.*; |
18 | 20 | |
... | ... | @@ -22,10 +24,8 @@ |
22 | 24 | import java.awt.*; |
23 | 25 | import java.io.IOException; |
24 | 26 | import java.io.InputStream; |
25 | -import java.util.ArrayList; | |
27 | +import java.util.*; | |
26 | 28 | import java.util.List; |
27 | -import java.util.Map; | |
28 | -import java.util.List; | |
29 | 29 | |
30 | 30 | /** |
31 | 31 | * 所有查看页面接口 |
... | ... | @@ -259,64 +259,6 @@ |
259 | 259 | } |
260 | 260 | builder.endRow(); |
261 | 261 | } |
262 | - | |
263 | - // Table table = (Table) allTables.get(0); //拿到表格 | |
264 | - /*for(int i=0; i<allAntExList.size(); i++) { | |
265 | - Row r2 = new Row(doc); | |
266 | - for (int a =0;a<allAntExList.get(i).size();a++) { | |
267 | - Paragraph p = new Paragraph(doc); | |
268 | - if(allAntExList.get(i).get(a)!=null){ | |
269 | - Cell c1 = new Cell(doc); | |
270 | - p.appendChild(new Run(doc, allAntExList.get(i).get(a))); | |
271 | - c1.appendChild(p); | |
272 | - r2.getCells().add(c1); | |
273 | - CellFormat cellFormat = c1.getCellFormat(); | |
274 | - cellFormat.setWidth(58); | |
275 | - } | |
276 | - } | |
277 | - System.out.println("::===="+table.getRows().getCount()); | |
278 | - table.getRows().insert(table.getRows().getCount(),r2); | |
279 | - }*/ | |
280 | - | |
281 | - | |
282 | - // DataTable visitTb = new DataTable("antExData"); //网站访问量表格 | |
283 | - // visitTb.getColumns().add("checkDate"); //0 增加三个列 日期 | |
284 | - // visitTb.getColumns().add("dueWeek"); //1 IP访问数量 | |
285 | - // visitTb.getColumns().add("hightRisk"); //2 页面浏览量 | |
286 | - // visitTb.getColumns().add("scale"); //2 页面浏览量 | |
287 | - // visitTb.getColumns().add("treatOpinion"); //2 页面浏览量 | |
288 | - // visitTb.getColumns().add("checkUnit"); //2 页面浏览量 | |
289 | - // visitTb.getColumns().add("doctName"); //2 页面浏览量 | |
290 | - // //向表格中填充数据 | |
291 | - // for(int i=1; i<allAntExList.size(); i++){ | |
292 | - // Map mp = allAntExList.get(i); | |
293 | - // DataRow row = visitTb.newRow(); //新增一行 | |
294 | - // row.set(0, mp.get("checkDate")); //根据列顺序填入数值 | |
295 | - // row.set(1, mp.get("dueWeek")); | |
296 | - // row.set(2, mp.get("hightRisk")); | |
297 | - // row.set(3, mp.get("scale")); | |
298 | - // row.set(4, mp.get("treatOpinion")); | |
299 | - // row.set(5, mp.get("checkUnit")); | |
300 | - // row.set(6, mp.get("doctName")); | |
301 | - // visitTb.getRows().add(row ); //加入此行数据 | |
302 | - // } | |
303 | - // //对于无数据的情况,增加一行空记录 | |
304 | - // if( visitTb.getRows().getCount() == 0 ){ | |
305 | - // DataRow row = visitTb.newRow(); | |
306 | - // visitTb.getRows().add( row ); | |
307 | - // } | |
308 | - // doc.getMailMerge().executeWithRegions( visitTb ); //调用接口 | |
309 | - | |
310 | - | |
311 | - // for(Map<String,String> mp:allAntExList){ | |
312 | - // for(Map.Entry<String,String> m:mp.entrySet()){ | |
313 | - // Bookmark mark = doc.getRange().getBookmarks().get(m.getKey()); | |
314 | - // if (mark != null&&m.getValue()!=null) { | |
315 | - // System.out.println(m.getKey()+":"+m.getValue()); | |
316 | - // mark.setText(m.getValue()); | |
317 | - // } | |
318 | - // } | |
319 | - // } | |
320 | 262 | sendToBrowser(doc, "导出", "doc", true, response); |
321 | 263 | } catch (Exception e) { |
322 | 264 | e.printStackTrace(); |
... | ... | @@ -373,6 +315,51 @@ |
373 | 315 | e.printStackTrace(); |
374 | 316 | } |
375 | 317 | } |
318 | + | |
319 | + | |
320 | + /** | |
321 | + * 诸城孕产妇妊娠风险评估分级报告单.docx | |
322 | + * @param id | |
323 | + * @param request | |
324 | + * @param response | |
325 | + */ | |
326 | + @RequestMapping(value = "/downFxpjbgDoc", method = RequestMethod.GET) | |
327 | + @TokenRequired | |
328 | + public void downFxpjbgDoc(@RequestParam("id") String id, HttpServletRequest request, HttpServletResponse response) { | |
329 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
330 | + Map<String, Object> map = viewFacade.expHightPjData(id, loginState.getId()); | |
331 | + try { | |
332 | + // 验证License | |
333 | + if (!getLicense()) { | |
334 | + return; | |
335 | + } | |
336 | + Document doc = null;// 原始word路径 | |
337 | + try { | |
338 | + doc = new Document(ViewController.class.getClassLoader().getResourceAsStream("fxpjbg.docx")); | |
339 | + | |
340 | + DocumentBuilder builder = new DocumentBuilder(doc); | |
341 | + if (map.containsKey("red")) { | |
342 | + builder.moveToBookmark("red"); | |
343 | + markFrameText(builder, (String) map.get("red")); | |
344 | + map.remove("red"); | |
345 | + } | |
346 | + if (map.containsKey("orange")) { | |
347 | + builder.moveToBookmark("orange"); | |
348 | + markFrameText(builder, (String) map.get("orange")); | |
349 | + map.remove("orange"); | |
350 | + } | |
351 | + | |
352 | + markData(doc, map);//普通数据 | |
353 | + sendToBrowser(doc, "导出", "doc", true, response); | |
354 | + } catch (Exception e) { | |
355 | + e.printStackTrace(); | |
356 | + } | |
357 | + response.flushBuffer(); | |
358 | + } catch (IOException e) { | |
359 | + e.printStackTrace(); | |
360 | + } | |
361 | + } | |
362 | + | |
376 | 363 | |
377 | 364 | /** |
378 | 365 | * 导出随访表 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
7eb87a7
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 | import com.lyms.platform.biz.SequenceConstant; |
4 | 4 | import com.lyms.platform.biz.service.*; |
5 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
6 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
6 | 7 | import com.lyms.platform.common.enums.*; |
7 | 8 | import com.lyms.platform.common.result.BaseObjectResponse; |
8 | 9 | import com.lyms.platform.common.result.BaseResponse; |
... | ... | @@ -3329,6 +3330,155 @@ |
3329 | 3330 | map.put("mremark", com.lyms.platform.common.utils.StringUtils.isEmpty(patients.getMremark(), "")); |
3330 | 3331 | List<List<String>> allAntExList = getAntExAll(patients, map); |
3331 | 3332 | map.put("antExData", allAntExList); |
3333 | + } | |
3334 | + | |
3335 | + return map; | |
3336 | + } | |
3337 | + | |
3338 | + | |
3339 | + | |
3340 | + public Map expHightPjData(String id, Integer userId) { | |
3341 | + Map map = new HashMap(); | |
3342 | + Patients patients = patientsService.findOnePatientById(id); | |
3343 | + if (patients != null) { | |
3344 | + /* 基础信息 */ | |
3345 | + map.put("id", id); | |
3346 | + map.put("userName", patients.getUsername()); | |
3347 | + map.put("age", DateUtil.getAge(patients.getBirth(), new Date()) + ""); | |
3348 | + map.put("birth", DateUtil.getyyyy_MM_dd(patients.getBirth())); | |
3349 | + | |
3350 | + map.put("week",DateUtil.getWeek(patients.getLastMenses(), new Date())+""); | |
3351 | + map.put("cardNo", patients.getCardNo()); | |
3352 | + | |
3353 | + map.put("address", CommonsHelper.getResidence(patients.getProvinceRegisterId(), patients.getCityRegisterId(), | |
3354 | + patients.getAreaRegisterId(), patients.getStreetRegisterId(), patients.getAddressRegister(), basicConfigService)); | |
3355 | + | |
3356 | + map.put("phone", com.lyms.platform.common.utils.StringUtils.isEmpty(patients.getPhone(), "")); | |
3357 | + | |
3358 | + StringBuffer sb = new StringBuffer(); | |
3359 | + | |
3360 | + AntExQuery antExQuery = new AntExQuery(); | |
3361 | + antExQuery.setParentId(patients.getId()); | |
3362 | + antExQuery.setYn(YnEnums.YES.getId()); | |
3363 | + List<AntenatalExaminationModel> list = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery().addOrder(Sort.Direction.DESC, "checkDate").addOrder(Sort.Direction.DESC, "created")); | |
3364 | + if (CollectionUtils.isNotEmpty(list)) | |
3365 | + { | |
3366 | + AntenatalExaminationModel antenatalExaminationModel = list.get(0); | |
3367 | + String otherHighRisk= antenatalExaminationModel.getOtherRisk(); | |
3368 | + | |
3369 | + List<Map> otherHighRisks = new ArrayList<>(); | |
3370 | + if (!(StringUtils.isEmpty(otherHighRisk)||"{}".equals(otherHighRisk)||"[]".equals(otherHighRisk))) { | |
3371 | + if (otherHighRisk.startsWith("[") && otherHighRisk.endsWith("]")) { | |
3372 | + List<Map> list2 = JsonUtil.toList(otherHighRisk, Map.class); | |
3373 | + otherHighRisks.addAll(list2); | |
3374 | + } else { | |
3375 | + Map otherMap = JsonUtil.jkstr2Obj(otherHighRisk, Map.class); | |
3376 | + otherHighRisks.add(otherMap); | |
3377 | + } | |
3378 | + | |
3379 | + for (Map fmap : otherHighRisks) { | |
3380 | + if (fmap.get("fyyse") != null) { | |
3381 | + String fyyse = fmap.get("fyyse").toString(); | |
3382 | + if (StringUtils.isNotEmpty(fyyse) && (fyyse.contains("49a36aea-c5b6-4162-87d2-9eb3c6ec00c2") || | |
3383 | + fyyse.contains("eb146c03-b19f-4e28-b85f-fda574b2283b"))) | |
3384 | + { | |
3385 | + sb.append(fmap.get("fxysu").toString()); | |
3386 | + sb.append("、"); | |
3387 | + } | |
3388 | + } | |
3389 | + } | |
3390 | + } | |
3391 | + | |
3392 | + } | |
3393 | + else | |
3394 | + { | |
3395 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
3396 | + antExChuQuery.setParentId(patients.getId()); | |
3397 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
3398 | + MongoQuery mongoQuery = antExChuQuery.convertToQuery(); | |
3399 | + mongoQuery.addOrder(Sort.Direction.DESC, "checkTime"); | |
3400 | + List<AntExChuModel> list1 = antenatalExaminationService.queryAntExChu(mongoQuery); | |
3401 | + if (CollectionUtils.isNotEmpty(list1)) | |
3402 | + { | |
3403 | + AntExChuModel antExChuModel = list1.get(0); | |
3404 | + if (null != antExChuModel && !"{}".equals(antExChuModel.getOtherHighRisk()) && !"[]".equals(antExChuModel.getOtherHighRisk())) { | |
3405 | + | |
3406 | + String otherHighRisk = antExChuModel.getOtherHighRisk(); | |
3407 | + List<Map> otherHighRisks = new ArrayList<>(); | |
3408 | + if (!(StringUtils.isEmpty(otherHighRisk)||"{}".equals(otherHighRisk)||"[]".equals(otherHighRisk))) { | |
3409 | + if (otherHighRisk.startsWith("[") && otherHighRisk.endsWith("]")) { | |
3410 | + List<Map> list2 = JsonUtil.toList(otherHighRisk, Map.class); | |
3411 | + otherHighRisks.addAll(list2); | |
3412 | + } else { | |
3413 | + Map otherMap = JsonUtil.jkstr2Obj(otherHighRisk, Map.class); | |
3414 | + otherHighRisks.add(otherMap); | |
3415 | + } | |
3416 | + | |
3417 | + for (Map fmap : otherHighRisks) { | |
3418 | + if (fmap.get("fyyse") != null) { | |
3419 | + String fyyse = fmap.get("fyyse").toString(); | |
3420 | + if (StringUtils.isNotEmpty(fyyse) && (fyyse.contains("49a36aea-c5b6-4162-87d2-9eb3c6ec00c2") || | |
3421 | + fyyse.contains("eb146c03-b19f-4e28-b85f-fda574b2283b"))) | |
3422 | + { | |
3423 | + sb.append(fmap.get("fxysu").toString()); | |
3424 | + sb.append("、"); | |
3425 | + } | |
3426 | + } | |
3427 | + } | |
3428 | + } | |
3429 | + | |
3430 | + } | |
3431 | + } | |
3432 | + } | |
3433 | + | |
3434 | + | |
3435 | + if (StringUtils.isNotEmpty(patients.getRiskLevelId()) && (patients.getRiskLevelId().contains("eb146c03-b19f-4e28-b85f-fda574b2283b") | |
3436 | + || patients.getRiskLevelId().contains("49a36aea-c5b6-4162-87d2-9eb3c6ec00c2")) ) | |
3437 | + { | |
3438 | + | |
3439 | + if (patients.getRiskLevelId().contains("eb146c03-b19f-4e28-b85f-fda574b2283b")) | |
3440 | + { | |
3441 | + map.put("red", "√"); | |
3442 | + } | |
3443 | + else | |
3444 | + { | |
3445 | + map.put("orange", "√"); | |
3446 | + } | |
3447 | + | |
3448 | + if (CollectionUtils.isNotEmpty(patients.getRiskFactorId())) | |
3449 | + { | |
3450 | + for (String rid : patients.getRiskFactorId()) | |
3451 | + { | |
3452 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(rid); | |
3453 | + if (basicConfig.getParentId().contains("49a36aea-c5b6-4162-87d2-9eb3c6ec00c2") || | |
3454 | + basicConfig.getParentId().contains("eb146c03-b19f-4e28-b85f-fda574b2283b")) | |
3455 | + { | |
3456 | + sb.append(basicConfig.getName()); | |
3457 | + sb.append("、"); | |
3458 | + } | |
3459 | + } | |
3460 | + } | |
3461 | + } | |
3462 | + map.put("risk", StringUtils.isNotEmpty(sb.toString()) ? sb.toString().substring(0, sb.toString().length() - 1) : "" ); | |
3463 | + | |
3464 | + String[] times = DateUtil.getyyyy_MM_dd(new Date()).split("-"); | |
3465 | + map.put("yy", times[0]); | |
3466 | + map.put("mm", times[1]); | |
3467 | + map.put("dd", times[2]); | |
3468 | + | |
3469 | + | |
3470 | + | |
3471 | + Users user = usersService.getUsers(userId); | |
3472 | + | |
3473 | + if (user != null) | |
3474 | + { | |
3475 | + map.put("doctor", user.getName()); | |
3476 | + Organization organization = organizationService.getOrganization(user.getOrgId()); | |
3477 | + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { | |
3478 | + map.put("hospitalName", organization.getName()); | |
3479 | + } | |
3480 | + } | |
3481 | + map.put("time", DateUtil.getyyyy_MM_dd(new Date())); | |
3332 | 3482 | } |
3333 | 3483 | |
3334 | 3484 | return map; |
platform-operate-api/src/main/resources/fxpjbg.docx
View file @
7eb87a7