Bläddra i källkod

feat(对接交行):所有代码

Wangyafan 1 månad sedan
förälder
incheckning
9a054d9fbd

+ 14 - 25
src/main/java/com/inkasso/factoring/bocom/vipaccount/entity/BocomVipAccountBasicInfo.java

@@ -143,6 +143,12 @@ public class BocomVipAccountBasicInfo extends BaseEntity {
     @TableField("chdbok_sts")
     private Integer chdbokSts;
 
+    /**
+     * 账户状态(真实)
+     */
+    @TableField("account_status_real")
+    private String accountStatusReal;
+
     /**
      * 付款方账户信息
      */
@@ -209,21 +215,12 @@ public class BocomVipAccountBasicInfo extends BaseEntity {
     @TableField(exist = false)
     private List<BocomVipBindAccountInfo> bindAccountInfoList = new ArrayList<>();
 
-    @TableField(exist = false)
-    private String customerStatus;
-
     /**
      * 认证人
      */
     @TableField(exist = false)
     private String authenticator;
 
-    /**
-     * 账户状态(真实)
-     */
-    @TableField(exist = false)
-    private String accountStatusReal;
-
     public List<BocomVipSilentAccountInfo> getSilentAccountInfoList() {
         return silentAccountInfoList;
     }
@@ -440,14 +437,6 @@ public class BocomVipAccountBasicInfo extends BaseEntity {
         this.deleteSilentIds = deleteSilentIds;
     }
 
-    public String getCustomerStatus() {
-        return customerStatus;
-    }
-
-    public void setCustomerStatus(String customerStatus) {
-        this.customerStatus = customerStatus;
-    }
-
     public String getPlfmSerNo() {
         return plfmSerNo;
     }
@@ -472,14 +461,6 @@ public class BocomVipAccountBasicInfo extends BaseEntity {
         this.legalAuthorizationStatus = legalAuthorizationStatus;
     }
 
-    public String getAccountStatusReal() {
-        return accountStatusReal;
-    }
-
-    public void setAccountStatusReal(String accountStatusReal) {
-        this.accountStatusReal = accountStatusReal;
-    }
-
     public Integer getChdbokSts() {
         return chdbokSts;
     }
@@ -496,6 +477,14 @@ public class BocomVipAccountBasicInfo extends BaseEntity {
         this.noticeObject = noticeObject;
     }
 
+    public String getAccountStatusReal() {
+        return accountStatusReal;
+    }
+
+    public void setAccountStatusReal(String accountStatusReal) {
+        this.accountStatusReal = accountStatusReal;
+    }
+
     @Override
     public String toString() {
         return "BocomVipAccountBasicInfo{" +

+ 56 - 52
src/main/java/com/inkasso/factoring/bocom/vipaccount/service/impl/BocomVipAccountBasicInfoServiceImpl.java

@@ -12,6 +12,7 @@ import com.inkasso.factoring.bocom.register.entity.BocomAuthorizedAgent;
 import com.inkasso.factoring.bocom.register.entity.BocomBasicInfo;
 import com.inkasso.factoring.bocom.register.entity.BocomLegalPersonInfo;
 import com.inkasso.factoring.bocom.register.entity.BocomShareholderActualController;
+import com.inkasso.factoring.bocom.register.enums.BocomCustomerStatuEnums;
 import com.inkasso.factoring.bocom.register.service.IBocomAuthorizedAgentService;
 import com.inkasso.factoring.bocom.register.service.IBocomBasicInfoService;
 import com.inkasso.factoring.bocom.register.service.IBocomLegalPersonInfoService;
@@ -114,7 +115,7 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
                 if (CollectionUtils.isNotEmpty(vipList)) {
                     vipList.forEach(vipAccountBasicInfo -> {
 
-                        autoAccountRealStatus(vipAccountBasicInfo);
+//                        autoAccountRealStatus(vipAccountBasicInfo);
 
                         if (bocomBasicInfo != null) {
                             //填充需要授权的人
@@ -155,10 +156,13 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
                         } else {
                             vipAccountBasicInfo.setIsRebuild(1);
                         }
-                        //客户状态
-                        if (customerStatusDic != null) {
-                            vo.setCustomerStatus(customerStatusDic.getName());
+
+                        //填充真实状态
+                        Dictionary customerStatusRealDic = dictionaryService.getByCode(vipAccountBasicInfo.getAccountStatusReal());
+                        if (customerStatusRealDic != null) {
+                            vipAccountBasicInfo.setAccountStatusReal(customerStatusRealDic.getName());
                         }
+
                         //静默户数量
                         Integer count = Math.toIntExact(bocomVipSilentAccoutInfoService.lambdaQuery()
                                 .eq(BocomVipSilentAccountInfo::getBocomVipAccountBasicInfoId, vipAccountBasicInfo.getId())
@@ -177,7 +181,7 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
                     vo.setVipAccountBasicInfoList(vipList);
                 }
 
-                if ("生效".equals(bocomBasicInfo.getCustomerRealStatus())) {
+                if (BocomCustomerStatuEnums.SUCCESS.getCode().equals(bocomBasicInfo.getCustomerStatus())) {
                     //客户真实状态为生效 且 该客户名下不存在待生效的登记簿 或者 该客户下账户状态为 生效的 会员登记簿少于五个时 展示新增账户按钮
                     Integer addVipAccount = 1;
                     if (CollectionUtil.isNotEmpty(vipList)){
@@ -491,53 +495,53 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
      *
      * @param vipAccountBasicInfo
      */
-    private void autoAccountRealStatus(BocomVipAccountBasicInfo vipAccountBasicInfo) {
-
-        if (vipAccountBasicInfo != null) {
-            BocomVipLimitInfo vipLimitInfo = bocomVipLimitInfoService
-                    .lambdaQuery()
-                    .eq(BocomVipLimitInfo::getBocomVipAccountBasicInfoId, vipAccountBasicInfo.getId())
-                    .one();
-
-            String realStatus = "";
-            if (vipAccountBasicInfo.getAccountStatus() == 1 ) {
-                // 授权状态 0-待用户授权 1-银行审核中 2-授权失败(用户拒绝)3-授权失败(银行拒绝)4-授权成功
-                //授权代理人授权状态
-                Integer authorizationStatus = vipAccountBasicInfo.getAuthorizationStatus();
-                //法人授权状态
-                Integer legalAuthorizationStatus = vipAccountBasicInfo.getLegalAuthorizationStatus();
-
-
-                if (authorizationStatus == 1 || legalAuthorizationStatus == 1 ||
-                        authorizationStatus == 2 || legalAuthorizationStatus == 2 ||
-                        authorizationStatus == 3 || legalAuthorizationStatus == 3) {
-                    //任一授权状态为 1/2/3 时 账户真实状态置为 开通失败
-                    realStatus = "开通失败";
-                }
-
-                if ((authorizationStatus == 0 || authorizationStatus == 4) && (authorizationStatus == 0 || authorizationStatus == 4)) {
-                    //授权状态组合为 0+0 || 0+4 时 且 可收可付款(无收入管控且无支出管控)且 接口返回的登记簿状态为是生效 时  账户真实状态置为 生效
-                    if (vipAccountBasicInfo.getChdbokSts() != null && vipAccountBasicInfo.getChdbokSts() == 1 || (vipLimitInfo != null && vipLimitInfo.getIncFlg() == 1 && vipLimitInfo.getPayFlg() == 1)) {
-                        realStatus = "生效";
-                    } else {
-                        //授权状态组合为 0+0 || 0+4 时 且 可收可付款(无收入管控且无支出管控) 时  账户真实状态置为 待生效
-                        realStatus = "待生效";
-                    }
-                }
-
-                if (authorizationStatus == 4 && authorizationStatus == 4) {
-                    //授权状态组合为 4+4 且 可收可付款(无收入管控且无支出管控) 时  账户真实状态置 为 生效
-                    if (vipAccountBasicInfo.getChdbokSts() != null && vipAccountBasicInfo.getChdbokSts() == 1 || (vipLimitInfo != null && vipLimitInfo.getIncFlg() == 1 && vipLimitInfo.getPayFlg() == 1)) {
-                        realStatus = "生效";
-                    }
-                }
-
-            } else {
-                realStatus = "失效";
-            }
-            vipAccountBasicInfo.setAccountStatusReal(realStatus);
-        }
-    }
+//    private void autoAccountRealStatus(BocomVipAccountBasicInfo vipAccountBasicInfo) {
+//
+//        if (vipAccountBasicInfo != null) {
+//            BocomVipLimitInfo vipLimitInfo = bocomVipLimitInfoService
+//                    .lambdaQuery()
+//                    .eq(BocomVipLimitInfo::getBocomVipAccountBasicInfoId, vipAccountBasicInfo.getId())
+//                    .one();
+//
+//            String realStatus = "";
+//            if (vipAccountBasicInfo.getAccountStatus() == 1 ) {
+//                // 授权状态 0-待用户授权 1-银行审核中 2-授权失败(用户拒绝)3-授权失败(银行拒绝)4-授权成功
+//                //授权代理人授权状态
+//                Integer authorizationStatus = vipAccountBasicInfo.getAuthorizationStatus();
+//                //法人授权状态
+//                Integer legalAuthorizationStatus = vipAccountBasicInfo.getLegalAuthorizationStatus();
+//
+//
+//                if (authorizationStatus == 1 || legalAuthorizationStatus == 1 ||
+//                        authorizationStatus == 2 || legalAuthorizationStatus == 2 ||
+//                        authorizationStatus == 3 || legalAuthorizationStatus == 3) {
+//                    //任一授权状态为 1/2/3 时 账户真实状态置为 开通失败
+//                    realStatus = "开通失败";
+//                }
+//
+//                if ((authorizationStatus == 0 || authorizationStatus == 4) && (authorizationStatus == 0 || authorizationStatus == 4)) {
+//                    //授权状态组合为 0+0 || 0+4 时 且 可收可付款(无收入管控且无支出管控)且 接口返回的登记簿状态为是生效 时  账户真实状态置为 生效
+//                    if (vipAccountBasicInfo.getChdbokSts() != null && vipAccountBasicInfo.getChdbokSts() == 1 || (vipLimitInfo != null && vipLimitInfo.getIncFlg() == 1 && vipLimitInfo.getPayFlg() == 1)) {
+//                        realStatus = "生效";
+//                    } else {
+//                        //授权状态组合为 0+0 || 0+4 时 且 可收可付款(无收入管控且无支出管控) 时  账户真实状态置为 待生效
+//                        realStatus = "待生效";
+//                    }
+//                }
+//
+//                if (authorizationStatus == 4 && authorizationStatus == 4) {
+//                    //授权状态组合为 4+4 且 可收可付款(无收入管控且无支出管控) 时  账户真实状态置 为 生效
+//                    if (vipAccountBasicInfo.getChdbokSts() != null && vipAccountBasicInfo.getChdbokSts() == 1 || (vipLimitInfo != null && vipLimitInfo.getIncFlg() == 1 && vipLimitInfo.getPayFlg() == 1)) {
+//                        realStatus = "生效";
+//                    }
+//                }
+//
+//            } else {
+//                realStatus = "失效";
+//            }
+//            vipAccountBasicInfo.setAccountStatus(realStatus);
+//        }
+//    }
 
 
 }