Ver código fonte

feat(会员登记簿):删除静默户

Wangyafan 4 semanas atrás
pai
commit
f985fca031

+ 28 - 29
src/main/java/com/inkasso/factoring/bocom/vipaccount/service/impl/BocomVipAccountBasicInfoServiceImpl.java

@@ -297,42 +297,41 @@ public class BocomVipAccountBasicInfoServiceImpl extends ServiceImpl<BocomVipAcc
                 bocomVipSilentAccoutInfoService.save(newSilentAccountInfo);
             }
 
-            if (CollectionUtil.isNotEmpty(basicInfo.getDeleteSilentIds())) {
-                //删除会员登记簿
-                for (Long deleteSilentId : basicInfo.getDeleteSilentIds()) {
-                    List<Long> ids = new ArrayList<>();
-                    ids.add(deleteSilentId);
-                    oldBasicInfo.setDeleteSilentIds(ids);
-                    try {
-                        responseJson = restTemplate.postForObject(bocomVipUpdateUrl, basicInfo, ResponseJson.class);
-                        if (!responseJson.getCode().equals(200)) {
-                            throw new BusinessException(CodeUtil.FAIL, responseJson.getMsg().toString());
-                        }
-
-                    } catch (Exception e) {
-                        throw new BusinessException(CodeUtil.FAIL, e.getMessage());
+        }
+        if (CollectionUtil.isNotEmpty(basicInfo.getDeleteSilentIds())) {
+            //删除会员登记簿
+            for (Long deleteSilentId : basicInfo.getDeleteSilentIds()) {
+                List<Long> ids = new ArrayList<>();
+                ids.add(deleteSilentId);
+                oldBasicInfo.setDeleteSilentIds(ids);
+                try {
+                    responseJson = restTemplate.postForObject(bocomVipUpdateUrl, basicInfo, ResponseJson.class);
+                    if (!responseJson.getCode().equals(200)) {
+                        throw new BusinessException(CodeUtil.FAIL, responseJson.getMsg().toString());
                     }
-                    bocomVipSilentAccoutInfoService.removeById(deleteSilentId);
-                }
 
+                } catch (Exception e) {
+                    throw new BusinessException(CodeUtil.FAIL, e.getMessage());
+                }
+                bocomVipSilentAccoutInfoService.removeById(deleteSilentId);
             }
 
-            if (responseJson != null){
-                BocomVipAccountBasicInfo newBasicInfo = JSONObject.parseObject(JSONObject.toJSONString(responseJson.getData()), BocomVipAccountBasicInfo.class);
+        }
 
-                updateById(newBasicInfo);
-                if (newBasicInfo.getBocomVipLimitInfo() != null) {
-                    BocomVipLimitInfo bocomVipLimitInfo = newBasicInfo.getBocomVipLimitInfo();
-                    BocomVipLimitInfo oldLimitInfo = bocomVipLimitInfoService.lambdaQuery()
-                            .eq(BocomVipLimitInfo::getBocomVipAccountBasicInfoId, newBasicInfo.getId())
-                            .one();
-                    bocomVipLimitInfo.setBocomVipAccountBasicInfoId(newBasicInfo.getId());
-                    bocomVipLimitInfo.setId(oldLimitInfo.getId());
-                    bocomVipLimitInfoService.updateById(bocomVipLimitInfo);
+        if (responseJson != null){
+            BocomVipAccountBasicInfo newBasicInfo = JSONObject.parseObject(JSONObject.toJSONString(responseJson.getData()), BocomVipAccountBasicInfo.class);
 
-                }
-            }
+            updateById(newBasicInfo);
+            if (newBasicInfo.getBocomVipLimitInfo() != null) {
+                BocomVipLimitInfo bocomVipLimitInfo = newBasicInfo.getBocomVipLimitInfo();
+                BocomVipLimitInfo oldLimitInfo = bocomVipLimitInfoService.lambdaQuery()
+                        .eq(BocomVipLimitInfo::getBocomVipAccountBasicInfoId, newBasicInfo.getId())
+                        .one();
+                bocomVipLimitInfo.setBocomVipAccountBasicInfoId(newBasicInfo.getId());
+                bocomVipLimitInfo.setId(oldLimitInfo.getId());
+                bocomVipLimitInfoService.updateById(bocomVipLimitInfo);
 
+            }
         }
     }