Commit 1016c48700c6a8f1de9accd639b24dc57b2e5f7c
1 parent
59654db548
Exists in
master
and in
1 other branch
code update
Showing 2 changed files with 154 additions and 126 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
1016c48
| ... | ... | @@ -236,7 +236,20 @@ |
| 236 | 236 | } |
| 237 | 237 | } |
| 238 | 238 | } |
| 239 | + BabyModelQuery babyQuery = new BabyModelQuery(); | |
| 240 | + babyQuery.setYn(YnEnums.YES.getId()); | |
| 241 | + babyQuery.setId(request.getId()); | |
| 242 | + List<BabyModel> list = babyBookbuildingService.queryBabyBuildByCond(babyQuery); | |
| 243 | + if (CollectionUtils.isNotEmpty(list)) | |
| 244 | + { | |
| 245 | + BabyModel babyModel = list.get(0); | |
| 246 | + if (babyModel.getServiceStatus() != ServiceStatusEnums.STANDARD_OPEN.getId() || babyModel.getServiceStatus() != ServiceStatusEnums.ADD_OPEN.getId()) | |
| 247 | + { | |
| 248 | + createBuildSms(babyModel); | |
| 249 | + } | |
| 250 | + } | |
| 239 | 251 | |
| 252 | + | |
| 240 | 253 | babyBookbuildingService.updateBabyBuild(model, request.getId()); |
| 241 | 254 | patientsService.updateRefer(model); |
| 242 | 255 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 243 | 256 | |
| 244 | 257 | |
| 245 | 258 | |
| 246 | 259 | |
| ... | ... | @@ -540,37 +553,131 @@ |
| 540 | 553 | query.setServiceType(serviceType); |
| 541 | 554 | query.setServiceStatus(serviceStatus); |
| 542 | 555 | } |
| 543 | - | |
| 556 | + List<SmsTemplateModel> sendList = new ArrayList<>(); | |
| 544 | 557 | List<SmsTemplateModel> temps = smsTemplateService.querySmsTemplates(query); |
| 545 | 558 | if (CollectionUtils.isNotEmpty(temps)) |
| 546 | 559 | { |
| 547 | 560 | |
| 548 | - SmsTemplateModel templateModel = temps.get(0); | |
| 549 | - if (templateModel != null && templateModel.getStatus() == 1) { | |
| 550 | - MessageListRequest smsList = new MessageListRequest(); | |
| 551 | - List<MessageRequest> messages = new ArrayList<>(); | |
| 552 | - MessageRequest mr = new MessageRequest(); | |
| 553 | - mr.setContent(templateModel.getContent()); | |
| 554 | - mr.setObjType(ServiceObjEnums.BABYOBJ.getId()); | |
| 555 | - mr.setPhone(babyModel.getMphone()); | |
| 556 | - //短信商 | |
| 557 | - mr.setServiceType(SmsProviderEnums.ALDY.getId()); | |
| 558 | - mr.setTypeId(ProjectTypeEnums.YNXT.getId()); | |
| 559 | - mr.setPlanTime(DateUtil.getyyyy_MM_dd_hms(new Date())); | |
| 560 | - mr.setSubTypeId(SmsServiceEnums.FWKT.getId()); | |
| 561 | - mr.setStatus(SmsStatusEnums.WFS.getId()); | |
| 561 | + for (SmsTemplateModel temp : temps) | |
| 562 | + { | |
| 563 | + if (temp.getServiceType() == serviceType && temp.getServiceStatus() == serviceStatus) | |
| 564 | + { | |
| 565 | + sendList.add(temp); | |
| 566 | + break; | |
| 567 | + } | |
| 568 | + } | |
| 562 | 569 | |
| 563 | - mr.setExt1(babyModel.getHospitalId()); | |
| 564 | - mr.setExt2(templateModel.getId()); | |
| 565 | - mr.setExt3(babyModel.getId()); | |
| 566 | - messages.add(mr); | |
| 570 | + for (SmsTemplateModel temp : temps) | |
| 571 | + { | |
| 572 | + if (temp.getServiceStatus() == ServiceStatusEnums.STANDARD_ALL.getId()) | |
| 573 | + { | |
| 574 | + if (serviceStatus == ServiceStatusEnums.STANDARD_OPEN.getId() || serviceStatus == ServiceStatusEnums.NO_OPEN.getId() || serviceStatus == ServiceStatusEnums.STANDARD_OVERDUE.getId() ) | |
| 575 | + { | |
| 576 | + sendList.add(temp); | |
| 577 | + break; | |
| 578 | + } | |
| 579 | + } | |
| 580 | + } | |
| 567 | 581 | |
| 568 | - if (CollectionUtils.isNotEmpty(messages)) { | |
| 569 | - smsList.setTypeId(ProjectTypeEnums.YNXT.getId()); | |
| 570 | - smsList.setMessages(messages); | |
| 571 | - MessageCenterService.saveSmsCenter(smsList); | |
| 582 | + for (SmsTemplateModel temp : temps) | |
| 583 | + { | |
| 584 | + if (temp.getServiceStatus() == ServiceStatusEnums.ADD_ALL.getId()) | |
| 585 | + { | |
| 586 | + if (serviceStatus == ServiceStatusEnums.ADD_OPEN.getId() || serviceStatus == ServiceStatusEnums.UNSUBSCRIBE.getId() | |
| 587 | + || serviceStatus == ServiceStatusEnums.ADD_OVERDUE.getId()|| serviceStatus == ServiceStatusEnums.SUSPEND.getId()) | |
| 588 | + { | |
| 589 | + sendList.add(temp); | |
| 590 | + break; | |
| 591 | + } | |
| 572 | 592 | } |
| 573 | 593 | } |
| 594 | + | |
| 595 | + | |
| 596 | + for (SmsTemplateModel temp : temps) | |
| 597 | + { | |
| 598 | + if (temp.getServiceStatus() == ServiceStatusEnums.ALL_OPEN.getId()) | |
| 599 | + { | |
| 600 | + if (serviceStatus == ServiceStatusEnums.STANDARD_OPEN.getId() || serviceStatus == ServiceStatusEnums.ADD_OPEN.getId() ) | |
| 601 | + { | |
| 602 | + sendList.add(temp); | |
| 603 | + break; | |
| 604 | + } | |
| 605 | + } | |
| 606 | + } | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + for (SmsTemplateModel temp : temps) | |
| 611 | + { | |
| 612 | + if (temp.getServiceStatus() == ServiceStatusEnums.ALL_NO_OPEN.getId()) | |
| 613 | + { | |
| 614 | + if (serviceStatus == ServiceStatusEnums.NO_OPEN.getId() || serviceStatus == ServiceStatusEnums.UNSUBSCRIBE.getId() ) | |
| 615 | + { | |
| 616 | + sendList.add(temp); | |
| 617 | + break; | |
| 618 | + } | |
| 619 | + } | |
| 620 | + } | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + for (SmsTemplateModel temp : temps) | |
| 625 | + { | |
| 626 | + if (temp.getServiceStatus() == ServiceStatusEnums.ALL_OVERDUE.getId()) | |
| 627 | + { | |
| 628 | + if (serviceStatus == ServiceStatusEnums.STANDARD_OVERDUE.getId() || serviceStatus == ServiceStatusEnums.ADD_OVERDUE.getId() ) | |
| 629 | + { | |
| 630 | + sendList.add(temp); | |
| 631 | + break; | |
| 632 | + } | |
| 633 | + } | |
| 634 | + } | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + for (SmsTemplateModel temp : temps) | |
| 639 | + { | |
| 640 | + if (temp.getServiceType() == ServiceTypeEnums.ALL_SERVICE.getId() && temp.getServiceStatus() == ServiceStatusEnums.ALL.getId()) | |
| 641 | + { | |
| 642 | + sendList.add(temp); | |
| 643 | + break; | |
| 644 | + } | |
| 645 | + } | |
| 646 | + | |
| 647 | + if (CollectionUtils.isNotEmpty(sendList)) | |
| 648 | + { | |
| 649 | + for (SmsTemplateModel templateModel : sendList) | |
| 650 | + { | |
| 651 | + if (templateModel != null && templateModel.getStatus() == 1) { | |
| 652 | + MessageListRequest smsList = new MessageListRequest(); | |
| 653 | + List<MessageRequest> messages = new ArrayList<>(); | |
| 654 | + MessageRequest mr = new MessageRequest(); | |
| 655 | + mr.setContent(templateModel.getContent()); | |
| 656 | + mr.setObjType(ServiceObjEnums.BABYOBJ.getId()); | |
| 657 | + mr.setPhone(babyModel.getMphone()); | |
| 658 | + //短信商 | |
| 659 | + mr.setServiceType(SmsProviderEnums.ALDY.getId()); | |
| 660 | + mr.setTypeId(ProjectTypeEnums.YNXT.getId()); | |
| 661 | + mr.setPlanTime(DateUtil.getyyyy_MM_dd_hms(new Date())); | |
| 662 | + mr.setSubTypeId(SmsServiceEnums.FWKT.getId()); | |
| 663 | + mr.setStatus(SmsStatusEnums.WFS.getId()); | |
| 664 | + | |
| 665 | + mr.setExt1(babyModel.getHospitalId()); | |
| 666 | + mr.setExt2(templateModel.getId()); | |
| 667 | + mr.setExt3(babyModel.getId()); | |
| 668 | + messages.add(mr); | |
| 669 | + | |
| 670 | + if (CollectionUtils.isNotEmpty(messages)) { | |
| 671 | + smsList.setTypeId(ProjectTypeEnums.YNXT.getId()); | |
| 672 | + smsList.setMessages(messages); | |
| 673 | + MessageCenterService.saveSmsCenter(smsList); | |
| 674 | + } | |
| 675 | + } | |
| 676 | + } | |
| 677 | + } | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 574 | 681 | } |
| 575 | 682 | } |
| 576 | 683 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
1016c48
| ... | ... | @@ -214,8 +214,12 @@ |
| 214 | 214 | //加入产筛 |
| 215 | 215 | patientsService.validata(p); |
| 216 | 216 | |
| 217 | - //生成建档短信 | |
| 218 | - createBuildSms(p); | |
| 217 | + if (type == 1) | |
| 218 | + { | |
| 219 | + //生成建档短信 | |
| 220 | + createBuildSms(p); | |
| 221 | + } | |
| 222 | + | |
| 219 | 223 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 220 | 224 | br.setErrormsg("成功"); |
| 221 | 225 | br.setData(p.getId()); |
| ... | ... | @@ -280,11 +284,6 @@ |
| 280 | 284 | |
| 281 | 285 | Integer serviceType = patient.getServiceType(); |
| 282 | 286 | Integer serviceStatus = patient.getServiceStatus(); |
| 283 | -// if (serviceType != null && serviceStatus != null) | |
| 284 | -// { | |
| 285 | -// query.setServiceType(serviceType); | |
| 286 | -// query.setServiceStatus(serviceStatus); | |
| 287 | -// } | |
| 288 | 287 | |
| 289 | 288 | List<SmsTemplateModel> sendList = new ArrayList<>(); |
| 290 | 289 | |
| ... | ... | @@ -377,100 +376,6 @@ |
| 377 | 376 | } |
| 378 | 377 | } |
| 379 | 378 | |
| 380 | - | |
| 381 | -// if (CollectionUtils.isNotEmpty(temps)) | |
| 382 | -// { | |
| 383 | -// SmsTemplateModel templateModel = null; | |
| 384 | -// for (SmsTemplateModel temp : temps) | |
| 385 | -// { | |
| 386 | -// if (temp.getServiceType() == serviceType && temp.getServiceStatus() == serviceStatus) | |
| 387 | -// { | |
| 388 | -// templateModel = temp; | |
| 389 | -// break; | |
| 390 | -// } | |
| 391 | -// } | |
| 392 | -// | |
| 393 | -// if (templateModel == null) | |
| 394 | -// { | |
| 395 | -// for (SmsTemplateModel temp : temps) | |
| 396 | -// { | |
| 397 | -// if (temp.getServiceStatus() == serviceStatus) | |
| 398 | -// { | |
| 399 | -// templateModel = temp; | |
| 400 | -// break; | |
| 401 | -// } | |
| 402 | -// } | |
| 403 | -// } | |
| 404 | -// | |
| 405 | -// if (templateModel == null) | |
| 406 | -// { | |
| 407 | -// for (SmsTemplateModel temp : temps) | |
| 408 | -// { | |
| 409 | -// if (temp.getServiceType() == serviceType) | |
| 410 | -// { | |
| 411 | -// templateModel = temp; | |
| 412 | -// break; | |
| 413 | -// } | |
| 414 | -// } | |
| 415 | -// } | |
| 416 | -// | |
| 417 | -// if (templateModel == null) | |
| 418 | -// { | |
| 419 | -// for (SmsTemplateModel temp : temps) | |
| 420 | -// { | |
| 421 | -// if (temp.getServiceStatus() == ServiceStatusEnums.ALL_OPEN.getId()) | |
| 422 | -// { | |
| 423 | -// if (serviceStatus == ServiceStatusEnums.STANDARD_OPEN.getId() || serviceStatus == ServiceStatusEnums.ADD_OPEN.getId() ) | |
| 424 | -// { | |
| 425 | -// templateModel = temp; | |
| 426 | -// break; | |
| 427 | -// } | |
| 428 | -// } | |
| 429 | -// } | |
| 430 | -// } | |
| 431 | -// | |
| 432 | -// if (templateModel == null) | |
| 433 | -// { | |
| 434 | -// for (SmsTemplateModel temp : temps) | |
| 435 | -// { | |
| 436 | -// if (temp.getServiceStatus() == ServiceStatusEnums.ALL_NO_OPEN.getId()) | |
| 437 | -// { | |
| 438 | -// if (serviceStatus == ServiceStatusEnums.NO_OPEN.getId() || serviceStatus == ServiceStatusEnums.UNSUBSCRIBE.getId() ) | |
| 439 | -// { | |
| 440 | -// templateModel = temp; | |
| 441 | -// break; | |
| 442 | -// } | |
| 443 | -// } | |
| 444 | -// } | |
| 445 | -// } | |
| 446 | -// | |
| 447 | -// if (templateModel == null) | |
| 448 | -// { | |
| 449 | -// for (SmsTemplateModel temp : temps) | |
| 450 | -// { | |
| 451 | -// if (temp.getServiceStatus() == ServiceStatusEnums.ALL_OVERDUE.getId()) | |
| 452 | -// { | |
| 453 | -// if (serviceStatus == ServiceStatusEnums.STANDARD_OVERDUE.getId() || serviceStatus == ServiceStatusEnums.ADD_OVERDUE.getId() ) | |
| 454 | -// { | |
| 455 | -// templateModel = temp; | |
| 456 | -// break; | |
| 457 | -// } | |
| 458 | -// } | |
| 459 | -// } | |
| 460 | -// } | |
| 461 | -// | |
| 462 | -// if (templateModel == null) | |
| 463 | -// { | |
| 464 | -// for (SmsTemplateModel temp : temps) | |
| 465 | -// { | |
| 466 | -// if (temp.getServiceType() == ServiceTypeEnums.ADD_SERVICE.getId() && temp.getServiceStatus() == ServiceStatusEnums.ALL.getId()) | |
| 467 | -// { | |
| 468 | -// templateModel = temp; | |
| 469 | -// break; | |
| 470 | -// } | |
| 471 | -// } | |
| 472 | -// } | |
| 473 | - | |
| 474 | 379 | if (CollectionUtils.isNotEmpty(sendList)) |
| 475 | 380 | { |
| 476 | 381 | for (SmsTemplateModel templateModel : sendList) |
| ... | ... | @@ -625,6 +530,22 @@ |
| 625 | 530 | patient.setId(id); |
| 626 | 531 | //加入产筛 |
| 627 | 532 | patientsService.validata(patient); |
| 533 | + | |
| 534 | + | |
| 535 | + PatientsQuery pQuery = new PatientsQuery(); | |
| 536 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
| 537 | + patientsQuery.setId(id); | |
| 538 | + List<Patients> list = yunBookbuildingService.queryPregnantWithQuery(pQuery); | |
| 539 | + if (CollectionUtils.isNotEmpty(list)) | |
| 540 | + { | |
| 541 | + Patients pat = list.get(0); | |
| 542 | + if (pat.getServiceStatus() != ServiceStatusEnums.STANDARD_OPEN.getId() || pat.getServiceStatus() != ServiceStatusEnums.ADD_OPEN.getId()) | |
| 543 | + { | |
| 544 | + createBuildSms(pat); | |
| 545 | + } | |
| 546 | + } | |
| 547 | + | |
| 548 | + | |
| 628 | 549 | yunBookbuildingService.updatePregnant(patient, id); |
| 629 | 550 | |
| 630 | 551 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |