Browse Source

feat(会员登记薄):重置授权二维码

Wangyafan 1 month ago
parent
commit
c21ab9c9d2

+ 27 - 19
src/main/java/com/inkasso/factoring/bocom/vipaccount/service/impl/BocomVipAccountBasicInfoServiceImpl.java

@@ -360,16 +360,9 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
                 throw new BusinessException(CodeUtil.FAIL, e.getMessage());
             }
             newVipAccount = JSONObject.parseObject(JSONObject.toJSONString(responseJson.getData()), BocomVipAccountBasicInfo.class);
-            //全删全进
-            bocomVipAccountNoticeInfoService.remove(new QueryWrapper<BocomVipAccountNoticeInfo>()
-                    .eq("bocom_vip_account_basic_info_id", newVipAccount.getId()));
-            if (CollectionUtil.isNotEmpty(newVipAccount.getNoticeInfoList())) {
-                newVipAccount.getNoticeInfoList().forEach(n -> {
-                    bocomVipAccountNoticeInfoService.save(n);
-                });
-            }
-
         }
+        autoAuthenticator(newVipAccount);
+
         return newVipAccount;
     }
 
@@ -463,16 +456,31 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
                     .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")) {
-                    n.setAuthenticator(authorizedAgent.getName());
-                }
-            });
+
+            List<BocomVipAccountNoticeInfo> noticeInfos = new ArrayList<>();
+            if (!"4".equals(bocomVipAccountBasicInfo.getLegalAuthorizationStatus())){
+                noticeInfoList.forEach(n->{
+                    if ("1".equals(n.getNoticeObject())){
+                        if (n.getNoticeObject().equals("1")) {
+                            if (basicInfo.getCustomerType() == 0) {
+                                n.setAuthenticator(legalPersonInfo.getName());
+                            } else if (basicInfo.getCustomerType() == 1) {
+                                n.setAuthenticator(actualController.getName());
+                            }
+
+                        }
+                        noticeInfos.add(n);
+                    }
+                });
+            }
+            if (!"4".equals(bocomVipAccountBasicInfo.getAuthorizationStatus())){
+                noticeInfoList.forEach(n->{
+                    if ("2".equals(n.getNoticeObject())){
+                        n.setAuthenticator(authorizedAgent.getName());
+                        noticeInfos.add(n);
+                    }
+                });
+            }
 
         }
         bocomVipAccountBasicInfo.setNoticeInfoList(noticeInfoList);