Commit db63a80f03d00705761b43543215fc54eabb6982

Authored by liquanyu
1 parent 79889c968d

统计

Showing 3 changed files with 413 additions and 241 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java View file @ db63a80
... ... @@ -235,56 +235,59 @@
235 235  
236 236 public BaseResponse queryAreaRiskPatientReport(RiskPatientsCountRequest countRequest, Integer userId) {
237 237  
238   -
239 238 //获取用户权限医院和筛选条件的交集
240 239 List<String> currentUserHospPermissions = areaCountFacade.getCurrentUserHospPermissions(userId, countRequest.getProvinceId(),
241 240 countRequest.getCityId(), countRequest.getAreaId());
242 241  
243   - currentUserHospPermissions.clear();
244   - currentUserHospPermissions.add("216");
245   -
246 242 //孕妇基础查询对象
247 243 PatientsQuery patientsQuery = new PatientsQuery();
248 244 patientsQuery.setYn(YnEnums.YES.getId());
249 245  
250   - //孕妇
251   - patientsQuery.setType(1);
252   - List buildType = new ArrayList();
253   - buildType.add(0);
254   - buildType.add(2);
255   - //建档类型
256   - patientsQuery.setBuildTypeList(buildType);
  246 + getRequestQuery(patientsQuery,countRequest);
257 247  
  248 + List<Map<String, Date>> times = null;
258 249  
  250 + if (StringUtils.isNotEmpty(countRequest.getTimeStart()) && StringUtils.isNotEmpty(countRequest.getTimeEnd()))
  251 + {
  252 + patientsQuery.setBookbuildingDateStart(DateUtil.parseYMD(countRequest.getTimeStart()));
  253 + patientsQuery.setBookbuildingDateEnd(DateUtil.parseYMD(countRequest.getTimeEnd()));
  254 + times = DateUtil.getRange(DateUtil.parseYMD(countRequest.getTimeStart()),
  255 + DateUtil.parseYMD(countRequest.getTimeEnd()));
  256 + }
  257 +
259 258 //查询高危分类
260 259 List<BasicConfig> riskLevelConfig = basicConfigService.queryByParentId(SystemConfig.HIGH_RISK_ID);
261 260  
262 261 Map<String,Object> datas = new HashMap<>();
263 262  
264   - List<Map> result = new ArrayList<>();
  263 + List<List<String>> result = new ArrayList<>();
265 264  
266 265 BasicConfigQuery basicQuery = new BasicConfigQuery();
267 266 basicQuery.setYn(YnEnums.YES.getId());
268 267 basicQuery.setTypeId("b7ea005c-dfac-4c2a-bdae-25239b3f44fd");
269 268  
270 269  
271   - List<Map<String, Object>> list = null;
272 270  
  271 +
  272 + String addressId = "";
273 273 if (StringUtils.isNotEmpty(countRequest.getProvinceId()))
274 274 {
275 275 basicQuery.setParentId(countRequest.getProvinceId());
276 276 countRequest.setExportType(1);
277 277  
278   - list = mongoUtil.getChilds(countRequest.getProvinceId());
  278 + addressId = countRequest.getProvinceId();
279 279 }
280 280  
281 281 if (StringUtils.isNotEmpty(countRequest.getCityId()))
282 282 {
283 283 basicQuery.setParentId(countRequest.getCityId());
284 284 countRequest.setExportType(2);
285   - list = mongoUtil.getChilds(countRequest.getCityId());
  285 + addressId = countRequest.getCityId();
286 286 }
287 287  
  288 + //获取地址列表
  289 + List<Map<String, Object>> list = mongoUtil.getChilds(addressId);
  290 +
288 291 if (StringUtils.isNotEmpty(countRequest.getAreaId()))
289 292 {
290 293 basicQuery.setParentId(countRequest.getAreaId());
291 294  
292 295  
293 296  
294 297  
295 298  
296 299  
297 300  
298 301  
299 302  
300 303  
301 304  
302 305  
303 306  
304 307  
305 308  
306 309  
307 310  
308 311  
309 312  
310 313  
311 314  
312 315  
313 316  
314 317  
315 318  
316 319  
317 320  
318 321  
319 322  
320 323  
321 324  
322 325  
323 326  
324 327  
325 328  
326 329  
327 330  
328 331  
329 332  
330 333  
331 334  
332 335  
333 336  
334 337  
335 338  
336 339  
337 340  
... ... @@ -293,293 +296,452 @@
293 296  
294 297 int addrType = countRequest.getExportType();
295 298  
296   - Map<String,Object> title = new HashMap<>();
297   - title.put("seq","序号");
  299 + List<String> title = new ArrayList<>();
  300 + title.add("序号");
298 301 if (addrType == 1)
299 302 {
300   - title.put("name","地市名称");
  303 + title.add("地市名称");
301 304 }
302 305 else if(addrType == 2)
303 306 {
304   - title.put("name","区县名称");
  307 + title.add("区县名称");
305 308 }
306 309 else
307 310 {
308   - title.put("name","医院名称");
  311 + title.add("医院名称");
309 312 }
310 313  
311 314 if (addrType < 3)
312 315 {
313   - title.put("orgNum","机构数");
  316 + title.add("机构数");
314 317 }
  318 + title.add("统计指标(人)");
315 319  
316   - title.put("countItem","统计指标(人)");
317   - title.put("sumNum", "合计");
318   - result.add(title);
319 320  
320 321  
321   - int seq = 0;
322   -
323   - //统计城市和区县表格数据
324   - if (addrType < 3)
325   - {
326   - List<BasicConfig> configList = basicConfigService.queryBasicConfig(basicQuery);
327   - OrganizationQuery query = new OrganizationQuery();
328   - query.setYn(YnEnums.YES.getId());
329   - if (CollectionUtils.isNotEmpty(configList))
330   - {
331   - for(BasicConfig c : configList)
332   - {
333   - if (addrType == 1)
334   - {
335   - query.setCityId(c.getId());
336   - }
337   - else if(addrType == 2)
338   - {
339   - query.setAreaId(c.getId());
340   - }
341   - //查询机构数
342   - List<Organization> orgs = organizationService.queryOrganization(query);
343   -
344   - List<String> hids = getConditionHospitalIds(currentUserHospPermissions,orgs);
345   -
346   - for (BasicConfig level : riskLevelConfig)
347   - {
348   -
349   - Map<String,Object> topMap = new HashMap<>();
350   - topMap.put("seq", ++seq);
351   - topMap.put("name", c .getName());
352   - topMap.put("orgNum", orgs == null ? 0 : orgs.size());
353   - topMap.put("countItem", level.getName());
354   -
355   - int riskPatientCount = 0;
356   - //权限和筛选条件不未空的时候就查询孕妇高危数量
357   - if (CollectionUtils.isNotEmpty(hids))
358   - {
359   -
360   - //权限
361   - patientsQuery.setHospitalList(hids);
362   -
363   - //高危等级
364   - patientsQuery.setrLevel(level.getId());
365   - //单个高危因素孕产妇条数
366   - riskPatientCount = patientsService.queryPatientCount(patientsQuery);
367   - }
368   -
369   - topMap.put("sumNum", riskPatientCount);
370   - result.add(topMap);
371   - }
372   - }
  322 + if (CollectionUtils.isNotEmpty(times)) {
  323 + for (Map<String, Date> time : times) {
  324 + title.add(DateUtil.getyyyy_mm(time.get("cname")));
373 325 }
374 326 }
375   - //统计医院的表格数据
376   - else
377   - {
378   - OrganizationQuery query = new OrganizationQuery();
379   - query.setYn(YnEnums.YES.getId());
380   - query.setAreaId(countRequest.getAreaId());
381   - List<Organization> orgs = organizationService.queryOrganization(query);
382   - if (CollectionUtils.isNotEmpty(orgs)) {
383   - for (Organization org : orgs) {
384   - for (BasicConfig level : riskLevelConfig) {
385   - Map<String, Object> topMap = new HashMap<>();
386   - topMap.put("seq", ++seq);
387   - topMap.put("name", org.getName());
388   - topMap.put("countItem", level.getName());
389 327  
390   - int riskPatientCount = 0;
391   - if (currentUserHospPermissions.contains(String.valueOf(org.getId())))
392   - {
393   - //权限
394   - patientsQuery.setHospitalId(String.valueOf(org.getId()));
395   - //高危等级
396   - patientsQuery.setrLevel(level.getId());
397   - //单个高危因素孕产妇条数
398   - riskPatientCount = patientsService.queryPatientCount(patientsQuery);
399   - }
  328 + title.add("合计");
  329 + result.add(title);
400 330  
401   - topMap.put("sumNum", riskPatientCount);
402   - result.add(topMap);
403   - }
404   - }
405   - }
406   - }
407 331  
408   - //表格合计计算
409   -// if(CollectionUtils.isNotEmpty(result))
  332 + //序列号
  333 + int seq = 0;
  334 +
  335 + //机构总数
  336 + int orgNumTotal = 0;
  337 +
  338 + //统计城市和区县表格数据
  339 +// if (addrType < 3)
410 340 // {
411   -// List<Map<String,Object>> totalMapList = new ArrayList<>();
412   -// for (BasicConfig level : riskLevelConfig)
  341 +// List<BasicConfig> configList = basicConfigService.queryBasicConfig(basicQuery);
  342 +// OrganizationQuery query = new OrganizationQuery();
  343 +// query.setYn(YnEnums.YES.getId());
  344 +// if (CollectionUtils.isNotEmpty(configList))
413 345 // {
414   -// Map<String,Object> totalMap = new HashMap<>();
415   -// totalMap.put("seq", ++seq);
416   -// totalMap.put("name", "合计");
417   -//
418   -// totalMap.put("countItem", level.getName());
419   -// int orgNumTotal = 0;
420   -// int levelTotal = 0;
421   -// if (addrType < 3)
  346 +// for(BasicConfig c : configList)
422 347 // {
  348 +// if (addrType == 1)
  349 +// {
  350 +// query.setCityId(c.getId());
  351 +// }
  352 +// else if(addrType == 2)
  353 +// {
  354 +// query.setAreaId(c.getId());
  355 +// }
  356 +// //查询机构数
  357 +// List<Organization> orgs = organizationService.queryOrganization(query);
423 358 //
424   -// for (Map map : result)
  359 +// orgNumTotal += CollectionUtils.isNotEmpty(orgs) ? orgs.size() : 0 ;
  360 +//
  361 +// List<String> hids = getConditionHospitalIds(currentUserHospPermissions,orgs);
  362 +//
  363 +// for (BasicConfig level : riskLevelConfig)
425 364 // {
426   -// if ("序号".equals(map.get("seq")))
  365 +//
  366 +// List<String> topList = new ArrayList<>();
  367 +// topList.add(String.valueOf(++seq));
  368 +// topList.add(c.getName());
  369 +// topList.add(orgs == null ? "0" : String.valueOf(orgs.size()));
  370 +// topList.add(level.getName());
  371 +// int riskPatientCount = 0;
  372 +//
  373 +// if (StringUtils.isNotEmpty(countRequest.getTimeStart()) )
427 374 // {
428   -// continue;
  375 +// if (CollectionUtils.isNotEmpty(times))
  376 +// {
  377 +// for (Map<String, Date> time : times)
  378 +// {
  379 +// if (CollectionUtils.isNotEmpty(hids))
  380 +// {
  381 +// patientsQuery.setBookbuildingDateStart(time.get("start"));
  382 +// patientsQuery.setBookbuildingDateEnd(time.get("end"));
  383 +//
  384 +// //权限
  385 +// patientsQuery.setHospitalList(hids);
  386 +//
  387 +// //高危等级
  388 +// patientsQuery.setrLevel(level.getId());
  389 +//
  390 +// riskPatientCount = patientsService.queryPatientCount(patientsQuery);
  391 +// }
  392 +// topList.add(String.valueOf(riskPatientCount));
  393 +// }
  394 +// }
429 395 // }
430   -// Integer orgNum = Integer.valueOf(String.valueOf(map.get("orgNum")));
431   -// orgNumTotal+=orgNum;
432 396 //
433   -// if (map.get("countItem").equals(level.getName()))
  397 +//
  398 +// //权限和筛选条件不未空的时候就查询孕妇高危数量
  399 +// if (CollectionUtils.isNotEmpty(hids))
434 400 // {
435   -// Integer sumNum =Integer.valueOf(String.valueOf(map.get("sumNum")));
436   -// levelTotal+=sumNum;
  401 +//
  402 +// //权限
  403 +// patientsQuery.setHospitalList(hids);
  404 +//
  405 +// //高危等级
  406 +// patientsQuery.setrLevel(level.getId());
  407 +//
  408 +//
  409 +// //单个高危因素孕产妇条数
  410 +// riskPatientCount = patientsService.queryPatientCount(patientsQuery);
437 411 // }
  412 +//
  413 +// topList.add(String.valueOf(riskPatientCount));
  414 +// result.add(topList);
438 415 // }
439 416 // }
440   -//
441   -// totalMap.put("orgNum", orgNumTotal);
442   -// totalMap.put("sumNum", levelTotal);
443   -// totalMapList.add(totalMap);
444 417 // }
445   -// result.addAll(totalMapList);
446 418 // }
447   -
448   -
449   -
450   -
451   -
452   - //统计柱状图数据封装--------------------------------
453   -
454   - //图标数据
455   - List<Map<String,Object>> series = new ArrayList<>();
456   -
457   - //x轴标题数据
458   - List<String> xAxis = new ArrayList<>();
459   -
460   - //分类标题
461   - List<String> titleItems = new ArrayList<>();
462   -
463   -
464   -// //获取分类标题数据
465   -// if (CollectionUtils.isNotEmpty(riskLevelConfig))
  419 +// //统计医院的表格数据
  420 +// else
466 421 // {
467   -// for (BasicConfig conf : riskLevelConfig)
468   -// {
469   -// titleItems.add(conf.getName());
470   -// }
471   -// }
  422 +// OrganizationQuery query = new OrganizationQuery();
  423 +// query.setYn(YnEnums.YES.getId());
  424 +// query.setAreaId(countRequest.getAreaId());
  425 +// List<Organization> orgs = organizationService.queryOrganization(query);
  426 +// if (CollectionUtils.isNotEmpty(orgs)) {
  427 +// for (Organization org : orgs) {
  428 +// for (BasicConfig level : riskLevelConfig) {
  429 +// List<String> topList = new ArrayList<>();
  430 +// topList.add(String.valueOf(++seq));
  431 +// topList.add(org.getName());
  432 +// topList.add(level.getName());
472 433 //
  434 +// int riskPatientCount = 0;
473 435 //
474   -// if (addrType < 3)
475   -// {
476   -// if (CollectionUtils.isNotEmpty(list))
477   -// {
478   -// for (Map<String, Object> addr : list)
479   -// {
480   -// xAxis.add(String.valueOf(addr.get("name")));
481   -// }
482   -// for (BasicConfig config : riskLevelConfig)
483   -// {
484   -// Map<String,Object> map = new HashMap();
485   -// map.put("name",config.getName());
486   -// map.put("type","bar");
  436 +// if (StringUtils.isNotEmpty(countRequest.getTimeStart()) )
  437 +// {
  438 +// if (CollectionUtils.isNotEmpty(times))
  439 +// {
  440 +// for (Map<String, Date> time : times)
  441 +// {
  442 +// if (currentUserHospPermissions.contains(String.valueOf(org.getId())))
  443 +// {
  444 +// patientsQuery.setBookbuildingDateStart(time.get("start"));
  445 +// patientsQuery.setBookbuildingDateEnd(time.get("end"));
487 446 //
  447 +// List<String> hids = new ArrayList<>();
  448 +// hids.add(String.valueOf(org.getId()));
  449 +// //权限
  450 +// patientsQuery.setHospitalList(hids);
488 451 //
489   -// OrganizationQuery idQuery = new OrganizationQuery();
490   -// idQuery.setYn(YnEnums.YES.getId());
  452 +// //高危等级
  453 +// patientsQuery.setrLevel(level.getId());
491 454 //
492   -// List<String> items = new ArrayList<>();
493   -// for (Map<String, Object> addr : list)
494   -// {
495   -// List<String> hids = new ArrayList<>();
496   -// String id = String.valueOf(addr.get("id"));
497   -// if (addrType == 1)
498   -// {
499   -// idQuery.setCityId(id);
  455 +// riskPatientCount = patientsService.queryPatientCount(patientsQuery);
  456 +// }
  457 +// topList.add(String.valueOf(riskPatientCount));
  458 +// }
  459 +// }
500 460 // }
501   -// else if(addrType == 2)
502   -// {
503   -// idQuery.setAreaId(id);
504   -// }
505 461 //
506   -// //查询机构数
507   -// List<Organization> orgs = organizationService.queryOrganization(idQuery);
508   -//
509   -// if (CollectionUtils.isNotEmpty(orgs))
  462 +// if (currentUserHospPermissions.contains(String.valueOf(org.getId())))
510 463 // {
511   -// for (Organization org : orgs)
512   -// {
513   -// hids.add(String.valueOf(org.getId()));
514   -// }
  464 +// List<String> hids = new ArrayList<>();
  465 +// hids.add(String.valueOf(org.getId()));
  466 +// //权限
  467 +// patientsQuery.setHospitalList(hids);
  468 +// //高危等级
  469 +// patientsQuery.setrLevel(level.getId());
  470 +// //单个高危因素孕产妇条数
  471 +// riskPatientCount = patientsService.queryPatientCount(patientsQuery);
515 472 // }
516 473 //
517   -// PatientsQuery query1 = new PatientsQuery();
518   -// query1.setHospitalList(hids);
519   -// query1.setYn(YnEnums.YES.getId());
520   -// query1.setType(1);
521   -// //高危等级
522   -// query1.setrLevel(config.getId());
523   -// List buildType = new ArrayList();
524   -// buildType.add(0);
525   -// buildType.add(2);
526   -// query1.setBuildTypeList(buildType);
527   -// Integer count = patientsService.queryPatientCount(query1);
528   -// items.add(count == null ? "0" : String.valueOf(count));
  474 +// topList.add(String.valueOf(riskPatientCount));
  475 +// result.add(topList);
529 476 // }
530   -// map.put("data",items);
531   -//
532   -// series.add(map);
533 477 // }
534 478 // }
535 479 // }
536   -// else if (addrType == 3)
  480 +//
  481 +// //表格合计计算
  482 +// if(CollectionUtils.isNotEmpty(result))
537 483 // {
538   -// OrganizationQuery organizationQuery = new OrganizationQuery();
539   -// organizationQuery.setYn(YnEnums.YES.getId());
540   -// organizationQuery.setAreaId(countRequest.getAreaId());
541 484 //
542   -// //TODO权限
543   -// // List<Organization> press = getCurrentOrgs( countRequest, userId);
544   -// List<Organization> orgs = organizationService.queryOrganization(organizationQuery);
  485 +// List<List<String>> totalAllList = new ArrayList<>();
  486 +// for (BasicConfig level : riskLevelConfig) {
  487 +// List<String> totalList = new ArrayList<>();
  488 +// totalList.add(String.valueOf(++seq));
  489 +// totalList.add("合计");
545 490 //
546   -// if (CollectionUtils.isNotEmpty(list))
547   -// {
548   -// for (Organization org : orgs)
549   -// {
550   -// xAxis.add(org.getName());
  491 +// if (addrType < 3) {
  492 +// totalList.add(String.valueOf(orgNumTotal));
  493 +// }
  494 +// totalList.add(level.getName());
551 495 //
552   -// Map<String,Object> map = new HashMap();
553   -// map.put("name",org.getName());
554   -// map.put("type", "bar");
555   -// List<String> items = new ArrayList<>();
556   -// for (BasicConfig config : riskLevelConfig)
  496 +// int index = addrType < 3 ? 4 : 3;
  497 +//
  498 +// for (int i = index ; i <= (times == null ? 0+index : times.size()+index) ; i++)
  499 +// {
  500 +// int total = 0;
  501 +// for (List<String> items : result)
557 502 // {
558   -// PatientsQuery query1 = new PatientsQuery();
559   -// query1.setHospitalId(String.valueOf(org.getId()));
560   -// query1.setYn(YnEnums.YES.getId());
561   -// query1.setType(1);
562   -// //高危等级
563   -// query1.setrLevel(config.getId());
564   -// List buildType = new ArrayList();
565   -// buildType.add(0);
566   -// buildType.add(2);
567   -// query1.setBuildTypeList(buildType);
568   -// Integer count = patientsService.queryPatientCount(query1);
569   -// items.add(count == null ? "0" : String.valueOf(count));
570   -// map.put("data",items);
  503 +// if (items.contains(level.getName()))
  504 +// {
  505 +// total+=Integer.valueOf(items.get(i));
  506 +// }
571 507 // }
572   -// series.add(map);
  508 +// totalList.add(String.valueOf(total));
573 509 // }
  510 +// totalAllList.add(totalList);
574 511 // }
  512 +// result.addAll(totalAllList);
575 513 // }
  514 +//
  515 +// for (List<String> items : result)
  516 +// {
  517 +// for (String item : items)
  518 +// {
  519 +// System.out.print(" "+ item);
  520 +// }
  521 +// System.out.println();
  522 +// }
576 523  
  524 +
  525 + //统计柱状图数据封装--------------------------------
  526 +
  527 + //图标数据
  528 + List<Map<String,Object>> series = new ArrayList<>();
  529 +
  530 + //x轴标题数据
  531 + List<String> xAxis = new ArrayList<>();
  532 +
  533 + //分类标题
  534 + List<String> titleItems = new ArrayList<>();
  535 +
  536 +
  537 + //获取分类标题数据
  538 + if (CollectionUtils.isNotEmpty(riskLevelConfig))
  539 + {
  540 + for (BasicConfig conf : riskLevelConfig)
  541 + {
  542 + titleItems.add(conf.getName());
  543 + }
  544 + }
  545 +
  546 +
  547 + if (addrType < 3)
  548 + {
  549 + if (CollectionUtils.isNotEmpty(list))
  550 + {
  551 + for (Map<String, Object> addr : list)
  552 + {
  553 + xAxis.add(String.valueOf(addr.get("name")));
  554 + }
  555 + for (BasicConfig config : riskLevelConfig)
  556 + {
  557 + Map<String,Object> map = new HashMap();
  558 + map.put("name",config.getName());
  559 + map.put("type","bar");
  560 +
  561 + OrganizationQuery idQuery = new OrganizationQuery();
  562 + idQuery.setYn(YnEnums.YES.getId());
  563 +
  564 + List<String> items = new ArrayList<>();
  565 + for (Map<String, Object> addr : list)
  566 + {
  567 + List<String> hids = new ArrayList<>();
  568 + String id = String.valueOf(addr.get("id"));
  569 + if (addrType == 1)
  570 + {
  571 + idQuery.setCityId(id);
  572 + }
  573 + else if(addrType == 2)
  574 + {
  575 + idQuery.setAreaId(id);
  576 + }
  577 +
  578 + //查询机构数
  579 + List<Organization> orgs = organizationService.queryOrganization(idQuery);
  580 +
  581 + if (CollectionUtils.isNotEmpty(orgs))
  582 + {
  583 + for (Organization org : orgs)
  584 + {
  585 + hids.add(String.valueOf(org.getId()));
  586 + }
  587 + }
  588 +
  589 + PatientsQuery query1 = new PatientsQuery();
  590 + query1.setHospitalList(hids);
  591 + query1.setYn(YnEnums.YES.getId());
  592 + query1.setType(1);
  593 + //高危等级
  594 + query1.setrLevel(config.getId());
  595 + List buildType = new ArrayList();
  596 + buildType.add(0);
  597 + buildType.add(2);
  598 + query1.setBuildTypeList(buildType);
  599 + Integer count = patientsService.queryPatientCount(query1);
  600 + items.add(count == null ? "0" : String.valueOf(count));
  601 + }
  602 + map.put("data",items);
  603 +
  604 + series.add(map);
  605 + }
  606 + }
  607 + }
  608 + else if (addrType == 3)
  609 + {
  610 + OrganizationQuery organizationQuery = new OrganizationQuery();
  611 + organizationQuery.setYn(YnEnums.YES.getId());
  612 + organizationQuery.setAreaId(countRequest.getAreaId());
  613 +
  614 + //TODO权限
  615 + // List<Organization> press = getCurrentOrgs( countRequest, userId);
  616 + List<Organization> orgs = organizationService.queryOrganization(organizationQuery);
  617 +
  618 + if (CollectionUtils.isNotEmpty(list))
  619 + {
  620 + for (Organization org : orgs)
  621 + {
  622 + xAxis.add(org.getName());
  623 +
  624 + Map<String,Object> map = new HashMap();
  625 + map.put("name",org.getName());
  626 + map.put("type", "bar");
  627 + List<String> items = new ArrayList<>();
  628 + for (BasicConfig config : riskLevelConfig)
  629 + {
  630 + PatientsQuery query1 = new PatientsQuery();
  631 + query1.setHospitalId(String.valueOf(org.getId()));
  632 + query1.setYn(YnEnums.YES.getId());
  633 + query1.setType(1);
  634 + //高危等级
  635 + query1.setrLevel(config.getId());
  636 + List buildType = new ArrayList();
  637 + buildType.add(0);
  638 + buildType.add(2);
  639 + query1.setBuildTypeList(buildType);
  640 + Integer count = patientsService.queryPatientCount(query1);
  641 + items.add(count == null ? "0" : String.valueOf(count));
  642 + map.put("data",items);
  643 + }
  644 + series.add(map);
  645 + }
  646 + }
  647 + }
  648 +
577 649 datas.put("series",series);
578 650 datas.put("xAxis",xAxis);
579 651 datas.put("legend",titleItems);
580 652 datas.put("tableDatas",result);
581 653 return new BaseObjectResponse()
582 654 .setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(datas);
  655 + }
  656 +
  657 + /**
  658 + * 查询条件
  659 + * @param patientsQuery
  660 + * @param countRequest
  661 + */
  662 +
  663 + private void getRequestQuery(PatientsQuery patientsQuery, RiskPatientsCountRequest countRequest) {
  664 + Date currentDate = new Date();
  665 +
  666 + //0:全部 1:20岁一下 2:25-30 3:30-40 4:40岁以上
  667 + if (countRequest.getAgeRange() != null && countRequest.getAgeRange() != 0)
  668 + {
  669 + int s = 0;
  670 + int e = 0;
  671 + if (countRequest.getAgeRange() == 1)
  672 + {
  673 + s = 0;e=20;
  674 + }
  675 + else if (countRequest.getAgeRange() == 2)
  676 + {
  677 + s = 25;e=30;
  678 + }
  679 + else if (countRequest.getAgeRange() == 3)
  680 + {
  681 + s = 31;e=40;
  682 + }
  683 + else if (countRequest.getAgeRange() == 4)
  684 + {
  685 + s = 41;e=100;
  686 + }
  687 +
  688 + Date start = DateUtil.addMonth(currentDate, s);
  689 + patientsQuery.setBirthEnd(start);
  690 +
  691 + Date end = DateUtil.addDay(DateUtil.addYear(currentDate, e - 1), 1);
  692 + patientsQuery.setBirthStart(end);
  693 + }
  694 +
  695 + //孕周 0 全部孕周 1:孕12周前 2:13-19 3:20-25 4:26-30 5:31-36 6:37-40 7:40-分娩前
  696 + if (countRequest.getWeek() != null && countRequest.getWeek() != 0)
  697 + {
  698 + int s = 0;
  699 + int e = 0;
  700 + if (countRequest.getWeek() == 1)
  701 + {
  702 + s = 0;e=12;
  703 + }
  704 + else if (countRequest.getWeek() == 2)
  705 + {
  706 + s = 13;e=19;
  707 + }
  708 + else if (countRequest.getWeek() == 3)
  709 + {
  710 + s = 20;e=25;
  711 + }
  712 + else if (countRequest.getWeek() == 4)
  713 + {
  714 + s = 26;e=30;
  715 + }
  716 + else if (countRequest.getWeek() == 5)
  717 + {
  718 + s = 31;e=36;
  719 + }
  720 + else if (countRequest.getWeek() == 6)
  721 + {
  722 + s = 37;e=40;
  723 + }
  724 + else if (countRequest.getWeek() == 7)
  725 + {
  726 + s = 41;e=42;
  727 + }
  728 +
  729 + Date startDate = DateUtil.addDay(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(new Date())), -(s*7));
  730 + Date endDate = DateUtil.addDay(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(new Date())), -(e*7)-6);
  731 +
  732 + patientsQuery.setLastMensesStart(endDate);
  733 + patientsQuery.setLastMensesEnd(startDate);
  734 + }
  735 +
  736 +
  737 + //孕妇
  738 + patientsQuery.setType(1);
  739 + List buildType = new ArrayList();
  740 + buildType.add(0);
  741 + buildType.add(2);
  742 + //建档类型
  743 + patientsQuery.setBuildTypeList(buildType);
  744 +
583 745 }
584 746  
585 747 public void exportAreaHighRisk(RiskPatientsCountRequest countRequest,
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/RiskPatientsCountRequest.java View file @ db63a80
... ... @@ -28,7 +28,8 @@
28 28 private Integer ageRange;
29 29  
30 30 //时间范围
31   - private String time;
  31 + private String timeStart;
  32 + private String timeEnd;
32 33  
33 34 //高危等级{}
34 35 private Map<String,String> riskLevel;
35 36  
... ... @@ -69,12 +70,20 @@
69 70 this.exportType = exportType;
70 71 }
71 72  
72   - public String getTime() {
73   - return time;
  73 + public String getTimeStart() {
  74 + return timeStart;
74 75 }
75 76  
76   - public void setTime(String time) {
77   - this.time = time;
  77 + public void setTimeStart(String timeStart) {
  78 + this.timeStart = timeStart;
  79 + }
  80 +
  81 + public String getTimeEnd() {
  82 + return timeEnd;
  83 + }
  84 +
  85 + public void setTimeEnd(String timeEnd) {
  86 + this.timeEnd = timeEnd;
78 87 }
79 88  
80 89 public Integer getCompareType() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java View file @ db63a80
... ... @@ -55,6 +55,7 @@
55 55 urls.put("area-chengde-api.healthbaby.com.cn:12356","承德");
56 56 urls.put("area-kaifeng-api.healthbaby.com.cn:12356","开封");
57 57 urls.put("area-weixian-api.healthbaby.com.cn:12356","威县");
  58 + urls.put("area-zhucheng-api.healthbaby.com.cn:12356","诸城市妇幼保健院");
58 59 }
59 60  
60 61 @Autowired