|
|
@@ -557,11 +557,10 @@ class UserBillRepository extends BaseRepository
|
|
557
|
557
|
$userCertificationRepository = app()->make(UserCertificationRepository::class);
|
|
558
|
558
|
$userCertificationEntityMapByUid = $userCertificationRepository->getUserCertificationEntityMapByUidListApproved($pensionUidList);
|
|
559
|
559
|
}
|
|
560
|
|
- /** @var GzcLogRepository $gzcLogRepository */
|
|
561
|
|
- $gzcLogRepository = app()->make(GzcLogRepository::class);
|
|
562
|
560
|
|
|
563
|
561
|
$updateUserEntityList = [];
|
|
564
|
562
|
$updateUserBillEntityList = [];
|
|
|
563
|
+ $gzcLogDataList = [];
|
|
565
|
564
|
foreach ($userBillEntityList as $userBillEntity) {
|
|
566
|
565
|
if (empty($userBillEntity->getBillId()) || empty($userBillEntity->getUid())) {
|
|
567
|
566
|
// throw new ValidateException('无效的账单记录');
|
|
|
@@ -615,15 +614,12 @@ class UserBillRepository extends BaseRepository
|
|
615
|
614
|
if (!empty($userCertificationEntityMapByUid[$userBillEntity->getUid()])) {
|
|
616
|
615
|
$userCertificationEntity = $userCertificationEntityMapByUid[$userBillEntity->getUid()];
|
|
617
|
616
|
// 创建公证处记录
|
|
618
|
|
- $gzcLogRepository->addGzcLog(
|
|
619
|
|
- $userCertificationEntity->getUid(),
|
|
620
|
|
- $userCertificationEntity->getUserName(),
|
|
621
|
|
- $userCertificationEntity->getMobile(),
|
|
622
|
|
- $userCertificationEntity->getUserCard(),
|
|
623
|
|
- $userBillEntity->getTypeShop(),
|
|
624
|
|
- $userBillEntity->getLinkId(),
|
|
625
|
|
- $userBillEntity->getNumber()
|
|
626
|
|
- );
|
|
|
617
|
+ $gzcLogDataList[$userBillEntity->getUid()][$userBillEntity->getLinkId()][] = [
|
|
|
618
|
+ 'uid' => $userCertificationEntity->getUid(),
|
|
|
619
|
+ 'userName' => $userCertificationEntity->getUserName(),
|
|
|
620
|
+ 'mobile' => $userCertificationEntity->getMobile(),
|
|
|
621
|
+ 'userCard' => $userCertificationEntity->getUserCard()
|
|
|
622
|
+ ];
|
|
627
|
623
|
|
|
628
|
624
|
// 养老金
|
|
629
|
625
|
if (is_null($updateUserEntity->getAnnuity())) {
|
|
|
@@ -657,11 +653,33 @@ class UserBillRepository extends BaseRepository
|
|
657
|
653
|
}
|
|
658
|
654
|
|
|
659
|
655
|
if (!empty($updateUserBillEntityList)) {
|
|
660
|
|
- $this->batchUpdateUserBillDataByDataList(
|
|
|
656
|
+ $userBillDataList = $this->batchUpdateUserBillDataByDataList(
|
|
661
|
657
|
array_map(function (UserBillEntity $updateUserBillEntity) {
|
|
662
|
658
|
return $updateUserBillEntity->toUnderlineArray();
|
|
663
|
659
|
}, $updateUserBillEntityList)
|
|
664
|
660
|
);
|
|
|
661
|
+ // 如果有需要写入公证处的数据
|
|
|
662
|
+ if (!empty($userBillDataList) && !empty($gzcLogDataList)) {
|
|
|
663
|
+ /** @var GzcLogRepository $gzcLogRepository */
|
|
|
664
|
+ $gzcLogRepository = app()->make(GzcLogRepository::class);
|
|
|
665
|
+ foreach ($userBillDataList as $userBillData) {
|
|
|
666
|
+ $userBillEntity = UserBillEntity::newInstance($userBillData);
|
|
|
667
|
+ if ($userBillEntity->getCommissionType() != UserBillEnum::COMMISSION_TYPE['PENSION']['code'] || empty($gzcLogDataList[$userBillEntity->getUid()][$userBillEntity->getLinkId()])) {
|
|
|
668
|
+ continue;
|
|
|
669
|
+ }
|
|
|
670
|
+ foreach ($gzcLogDataList[$userBillEntity->getUid()][$userBillEntity->getLinkId()] as $gzcLogData) {
|
|
|
671
|
+ $gzcLogRepository->addGzcLog(
|
|
|
672
|
+ $gzcLogData['uid'],
|
|
|
673
|
+ $gzcLogData['userName'],
|
|
|
674
|
+ $gzcLogData['mobile'],
|
|
|
675
|
+ $gzcLogData['userCard'],
|
|
|
676
|
+ $userBillEntity->getTypeShop(),
|
|
|
677
|
+ $userBillEntity->getBillId(),
|
|
|
678
|
+ $userBillEntity->getNumber()
|
|
|
679
|
+ );
|
|
|
680
|
+ }
|
|
|
681
|
+ }
|
|
|
682
|
+ }
|
|
665
|
683
|
}
|
|
666
|
684
|
}
|
|
667
|
685
|
|