Commit 1dfd325b3cdeabfc3920173b70dcf653a1ed5509
1 parent
bb4c0c2565
Exists in
master
and in
1 other branch
修改转诊
Showing 2 changed files with 43 additions and 39 deletions
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
1dfd325
... | ... | @@ -29,7 +29,7 @@ |
29 | 29 | |
30 | 30 | private String mphone; |
31 | 31 | private String mname; |
32 | - private String communityId; | |
32 | + private String communityId; | |
33 | 33 | |
34 | 34 | private Integer buildType; |
35 | 35 | |
... | ... | @@ -374,7 +374,6 @@ |
374 | 374 | @Override |
375 | 375 | public MongoQuery convertToQuery() { |
376 | 376 | MongoCondition condition = MongoCondition.newInstance(); |
377 | - boolean isAddStart = Boolean.FALSE; | |
378 | 377 | |
379 | 378 | if (-1 != visitstatus) { |
380 | 379 | condition = condition.and("visitstatus", visitstatus, MongoOper.IS); |
381 | 380 | |
382 | 381 | |
383 | 382 | |
384 | 383 | |
385 | 384 | |
386 | 385 | |
387 | 386 | |
388 | 387 | |
... | ... | @@ -391,38 +390,38 @@ |
391 | 390 | if (null != areaId) { |
392 | 391 | condition = condition.and("areaId", areaId, MongoOper.IS); |
393 | 392 | } |
394 | - if(null!=communityId){ | |
395 | - condition=condition.and("communityId",communityId,MongoOper.IS); | |
393 | + if (null != communityId) { | |
394 | + condition = condition.and("communityId", communityId, MongoOper.IS); | |
396 | 395 | } |
397 | - if(null!=isNull){ | |
398 | - condition=condition.and("communityId", null, MongoOper.IS); | |
396 | + if (null != isNull) { | |
397 | + condition = condition.and("communityId", null, MongoOper.IS); | |
399 | 398 | } |
400 | 399 | |
401 | - if(!StringUtils.isEmpty(mcertNo)){ | |
402 | - condition=condition.and("mcertNo", mcertNo, MongoOper.IS); | |
400 | + if (!StringUtils.isEmpty(mcertNo)) { | |
401 | + condition = condition.and("mcertNo", mcertNo, MongoOper.IS); | |
403 | 402 | } |
404 | - if(!StringUtils.isEmpty(cardNo)){ | |
405 | - condition=condition.and("cardNo", cardNo, MongoOper.IS); | |
403 | + if (!StringUtils.isEmpty(cardNo)) { | |
404 | + condition = condition.and("cardNo", cardNo, MongoOper.IS); | |
406 | 405 | } |
407 | 406 | |
408 | - if(!StringUtils.isEmpty(vcCardNo)){ | |
409 | - condition=condition.and("vcCardNo", vcCardNo, MongoOper.IS); | |
407 | + if (!StringUtils.isEmpty(vcCardNo)) { | |
408 | + condition = condition.and("vcCardNo", vcCardNo, MongoOper.IS); | |
410 | 409 | } |
411 | 410 | |
412 | - if(null!=hospitalId){ | |
413 | - condition=condition.and("hospitalId", hospitalId, MongoOper.IS); | |
411 | + if (null != hospitalId) { | |
412 | + condition = condition.and("hospitalId", hospitalId, MongoOper.IS); | |
414 | 413 | } |
415 | - if(!StringUtils.isEmpty(lastDiagnose)){ | |
416 | - condition=condition.and("lastDiagnose", lastDiagnose, MongoOper.IN); | |
414 | + if (!StringUtils.isEmpty(lastDiagnose)) { | |
415 | + condition = condition.and("lastDiagnose", lastDiagnose, MongoOper.IN); | |
417 | 416 | } |
418 | 417 | |
419 | - if(!StringUtils.isEmpty(phoneId) || !StringUtils.isEmpty(cardId)){ | |
418 | + if (!StringUtils.isEmpty(phoneId) || !StringUtils.isEmpty(cardId)) { | |
420 | 419 | MongoCondition con1 = MongoCondition.newInstance("phoneId", phoneId, MongoOper.LIKE); |
421 | 420 | MongoCondition con = MongoCondition.newInstance("cardId", cardId, MongoOper.LIKE); |
422 | 421 | condition = condition.orCondition(new MongoCondition[]{con1, con}); |
423 | 422 | } |
424 | 423 | |
425 | - if(null != buildTypeList) { | |
424 | + if (null != buildTypeList) { | |
426 | 425 | MongoCondition mongoCondition = MongoCondition.newInstance("buildType", 3, MongoOper.IS); |
427 | 426 | MongoCondition condition1 = mongoCondition.and("enable", "1", MongoOper.IS); |
428 | 427 | |
429 | 428 | |
430 | 429 | |
431 | 430 | |
432 | 431 | |
433 | 432 | |
434 | 433 | |
... | ... | @@ -431,32 +430,32 @@ |
431 | 430 | condition = condition.orCondition(new MongoCondition[]{condition1, condition2}); |
432 | 431 | } |
433 | 432 | |
434 | - if(null!=sex){ | |
435 | - condition=condition.and("sex", sex, MongoOper.IS); | |
433 | + if (null != sex) { | |
434 | + condition = condition.and("sex", sex, MongoOper.IS); | |
436 | 435 | } |
437 | 436 | |
438 | - if(null!=lastHighRisk){ | |
439 | - condition=condition.and("lastHighRisk", lastHighRisk, MongoOper.IS); | |
437 | + if (null != lastHighRisk) { | |
438 | + condition = condition.and("lastHighRisk", lastHighRisk, MongoOper.IS); | |
440 | 439 | } |
441 | 440 | |
442 | 441 | |
443 | - if(null!=serviceStatus){ | |
444 | - condition=condition.and("serviceStatus", serviceStatus, MongoOper.IS); | |
442 | + if (null != serviceStatus) { | |
443 | + condition = condition.and("serviceStatus", serviceStatus, MongoOper.IS); | |
445 | 444 | } |
446 | - if(null!=serviceType){ | |
447 | - condition=condition.and("serviceType", serviceType, MongoOper.IS); | |
445 | + if (null != serviceType) { | |
446 | + condition = condition.and("serviceType", serviceType, MongoOper.IS); | |
448 | 447 | } |
449 | 448 | |
450 | 449 | if (null != orServiceStatus && orServiceStatus.length > 1) { |
451 | - Criteria c = Criteria.where("serviceStatus").in(orServiceStatus[0],orServiceStatus[1]); | |
452 | - condition.andCondition( new MongoCondition(c)); | |
450 | + Criteria c = Criteria.where("serviceStatus").in(orServiceStatus[0], orServiceStatus[1]); | |
451 | + condition.andCondition(new MongoCondition(c)); | |
453 | 452 | } |
454 | 453 | |
455 | 454 | if (null != keyword) { |
456 | 455 | if (null != keyword) { |
457 | - MongoCondition con1 = MongoCondition.newInstance("mphone", "^"+keyword, MongoOper.LIKE); | |
456 | + MongoCondition con1 = MongoCondition.newInstance("mphone", "^" + keyword, MongoOper.LIKE); | |
458 | 457 | MongoCondition con |
459 | - = MongoCondition.newInstance("mname", "^"+keyword, MongoOper.LIKE); | |
458 | + = MongoCondition.newInstance("mname", "^" + keyword, MongoOper.LIKE); | |
460 | 459 | condition = condition.orCondition(new MongoCondition[]{con1, con}); |
461 | 460 | } |
462 | 461 | } |
463 | 462 | |
... | ... | @@ -492,10 +491,9 @@ |
492 | 491 | Criteria c = null; |
493 | 492 | if (null != birthStart) { |
494 | 493 | c = Criteria.where("birth").gte(birthStart); |
495 | - isAddStart = Boolean.TRUE; | |
496 | 494 | } |
497 | 495 | |
498 | - if (null != nextDateStart && nextDateEnd != null) { | |
496 | + if (null != nextDateStart && nextDateEnd != null) { | |
499 | 497 | |
500 | 498 | Criteria cr = Criteria.where("nextDate").gte(nextDateStart).lte(nextDateEnd); |
501 | 499 | condition.andCondition(new MongoCondition(cr)); |
502 | 500 | |
503 | 501 | |
504 | 502 | |
... | ... | @@ -503,22 +501,21 @@ |
503 | 501 | } |
504 | 502 | |
505 | 503 | if (null != gteModified && null != gteCreated) { |
506 | - MongoCondition mongoCondition = new MongoCondition("modified", gteModified, MongoOper.GTE); | |
504 | + MongoCondition mongoCondition = new MongoCondition("modified", gteModified, MongoOper.GTE); | |
507 | 505 | MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE); |
508 | 506 | condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2}); |
509 | 507 | } |
510 | 508 | |
511 | 509 | if (null != birthEnd) { |
512 | - if (isAddStart) { | |
510 | + if (null != c) { | |
513 | 511 | c = c.lte(birthEnd); |
514 | 512 | } else { |
515 | 513 | c = Criteria.where("birth").lte(birthEnd); |
516 | 514 | } |
517 | - isAddStart = Boolean.TRUE; | |
518 | 515 | } |
519 | 516 | |
520 | 517 | |
521 | - if(null!=buildDateStart){ | |
518 | + if (null != buildDateStart) { | |
522 | 519 | if (null != c) { |
523 | 520 | c = c.and("buildDate").gte(buildDateStart); |
524 | 521 | } else { |
... | ... | @@ -526,7 +523,7 @@ |
526 | 523 | } |
527 | 524 | } |
528 | 525 | |
529 | - if(null!=buildDateEnd){ | |
526 | + if (null != buildDateEnd) { | |
530 | 527 | if (null != c) { |
531 | 528 | c = c.lte(buildDateEnd); |
532 | 529 | } else { |
... | ... | @@ -534,7 +531,7 @@ |
534 | 531 | } |
535 | 532 | } |
536 | 533 | |
537 | - if (isAddStart) { | |
534 | + if (c != null) { | |
538 | 535 | return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); |
539 | 536 | } |
540 | 537 | return condition.toMongoQuery(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
1dfd325
... | ... | @@ -1585,7 +1585,14 @@ |
1585 | 1585 | if(org.apache.commons.lang.StringUtils.isNotEmpty(request.getDateRange())){ |
1586 | 1586 | String[] dates = request.getDateRange().split(" - "); |
1587 | 1587 | babyQuery.setBuildDateStart(DateUtil.parseYMD(dates[0])); |
1588 | - babyQuery.setBuildDateEnd(DateUtil.parseYMD(dates[1])); | |
1588 | + if(dates.length>=2){ | |
1589 | + Date date= DateUtil.parseYMD(dates[1]); | |
1590 | + if(dates[0].equals(dates[1])){ | |
1591 | + long d = DateUtil.parseYMD(dates[1]).getTime() + 86398000; | |
1592 | + date = new Date(d); | |
1593 | + } | |
1594 | + babyQuery.setBuildDateEnd(date); | |
1595 | + } | |
1589 | 1596 | } |
1590 | 1597 | |
1591 | 1598 | List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery); |