Ver código fonte

feat(对接交行):会员登记薄多人授权

Wangyafan 15 horas atrás
pai
commit
478d117c45

+ 21 - 8
src/main/java/com/inkasso/factoring/bocom/vipaccount/service/impl/BocomVipAccountBasicInfoServiceImpl.java

@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.inkasso.adapter.exception.BusinessException;
 import com.inkasso.adapter.util.CodeUtil;
-import com.inkasso.adapter.util.StringUtil;
 import com.inkasso.adapter.web.LoginUserHolder;
 import com.inkasso.factoring.bocom.register.entity.BocomAuthorizedAgent;
 import com.inkasso.factoring.bocom.register.entity.BocomBasicInfo;
@@ -154,7 +153,7 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
                         if (count > 0) {
                             addVipAccount = 0;
                         }
-                        long effectCount = vipList.stream().filter(c->c.getAccountStatus() != null).filter(c -> c.getAccountStatus() == 1).count();
+                        long effectCount = vipList.stream().filter(c -> c.getAccountStatus() != null).filter(c -> c.getAccountStatus() == 1).count();
                         if (effectCount > 4) {
                             addVipAccount = 0;
                         }
@@ -363,7 +362,7 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
             newVipAccount = JSONObject.parseObject(JSONObject.toJSONString(responseJson.getData()), BocomVipAccountBasicInfo.class);
             //全删全进
             bocomVipAccountNoticeInfoService.remove(new QueryWrapper<BocomVipAccountNoticeInfo>()
-                    .eq("bocom_vip_account_basic_info_id",newVipAccount.getId()));
+                    .eq("bocom_vip_account_basic_info_id", newVipAccount.getId()));
             if (CollectionUtil.isNotEmpty(newVipAccount.getNoticeInfoList())) {
                 newVipAccount.getNoticeInfoList().forEach(n -> {
                     bocomVipAccountNoticeInfoService.save(n);
@@ -440,11 +439,16 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
 
     /**
      * 填充授权代理人
+     *
      * @param bocomVipAccountBasicInfo
      */
-    private void autoAuthenticator(BocomVipAccountBasicInfo bocomVipAccountBasicInfo){
+    private void autoAuthenticator(BocomVipAccountBasicInfo bocomVipAccountBasicInfo) {
+
         BocomBasicInfo basicInfo = bocomBasicInfoService.getById(bocomVipAccountBasicInfo.getBocomBasicInfoId());
-        if (CollectionUtil.isNotEmpty(bocomVipAccountBasicInfo.getNoticeInfoList())) {
+        List<BocomVipAccountNoticeInfo> noticeInfoList = bocomVipAccountNoticeInfoService.lambdaQuery()
+                .eq(BocomVipAccountNoticeInfo::getBocomVipAccountBasicInfoId, bocomVipAccountBasicInfo.getId())
+                .list();
+        if (CollectionUtil.isNotEmpty(noticeInfoList)) {
             //授权代理人
             BocomAuthorizedAgent authorizedAgent = bocomAuthorizedAgentService.lambdaQuery()
                     .eq(BocomAuthorizedAgent::getBocomBasicInfoId, basicInfo.getId())
@@ -453,16 +457,25 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
             BocomLegalPersonInfo legalPersonInfo = bocomLegalPersonInfoService.lambdaQuery()
                     .eq(BocomLegalPersonInfo::getBocomBasicInfoId, basicInfo.getId())
                     .one();
-            bocomVipAccountBasicInfo.getNoticeInfoList().forEach(n->{
-                if (n.getNoticeObject().equals("1")){
+
+            //负责人
+            BocomShareholderActualController actualController = bocomShareholderActualControllerService.lambdaQuery()
+                    .eq(BocomShareholderActualController::getBocomBasicInfoId, basicInfo.getId())
+                    .eq(BocomShareholderActualController::getPersonType, 2)
+                    .one();
+            bocomVipAccountBasicInfo.getNoticeInfoList().forEach(n -> {
+                if (basicInfo.getCustomerType() == 0) {
                     n.setAuthenticator(legalPersonInfo.getName());
+                } else if (basicInfo.getCustomerType() == 1) {
+                    n.setAuthenticator(actualController.getName());
                 }
-                if (n.getNoticeObject().equals("2")){
+                if (n.getNoticeObject().equals("2")) {
                     n.setAuthenticator(authorizedAgent.getName());
                 }
             });
 
         }
+        bocomVipAccountBasicInfo.setNoticeInfoList(noticeInfoList);
     }