Jelajahi Sumber

Merge remote-tracking branch 'origin/master_feat_ysy_20250929' into master_feat_ysy_20250929

cgp 1 Minggu lalu
induk
melakukan
38efcc6cb2

+ 16 - 15
fs-service/src/main/java/com/fs/hisStore/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -633,21 +633,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
 
     @Override
     public FsUserInfoCollectionUVO info(Long id,Long userId) {
-        FsUserInformationCollection selectByUserId = fsUserInformationCollectionMapper.selectByUserId(userId);
-        if (selectByUserId != null) {
-            //查询此用户是否添加该销售企微好友,未添加提示添加销售
-            QwExternalContact externalContactCondition=new QwExternalContact();
-            externalContactCondition.setFsUserId(userId);
-            externalContactCondition.setCompanyUserId(selectByUserId.getCompanyUserId());
-            List<QwExternalContact> qwExternalContacts = qwExternalContactMapper.selectQwExternalContactList(externalContactCondition);
-            if (CollectionUtils.isEmpty(qwExternalContacts)){
-                log.error("客户二次提交采集信息,销售与分享客户之间没有企微好友关系,当前销售id:{},当前客户id:{}",selectByUserId.getCompanyUserId(),userId);
-                throw new CustomException("请添加分享销售企微好友!");
-            }
-            if (!selectByUserId.getId().equals(id)) {
-                throw new CustomException("已有信息采集信息!,请联系销售重新分享二维码!");
-            }
-        }
+
         FsUserInfoCollectionUVO vo = new FsUserInfoCollectionUVO();
         FsUserInformationCollection collection = fsUserInformationCollectionMapper.selectFsUserInformationCollectionById(id);
 
@@ -1318,6 +1304,21 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         if (collection.getUserId() != null) {
             return R.error("信息采集已绑定用户");
         }
+        FsUserInformationCollection selectByUserId = fsUserInformationCollectionMapper.selectByUserId(param.getUserId());
+        if (selectByUserId != null) {
+            //查询此用户是否添加该销售企微好友,未添加提示添加销售
+            QwExternalContact externalContactCondition=new QwExternalContact();
+            externalContactCondition.setFsUserId(param.getUserId());
+            externalContactCondition.setCompanyUserId(selectByUserId.getCompanyUserId());
+            List<QwExternalContact> qwExternalContacts = qwExternalContactMapper.selectQwExternalContactList(externalContactCondition);
+            if (CollectionUtils.isEmpty(qwExternalContacts)){
+                log.error("客户二次提交采集信息,销售与分享客户之间没有企微好友关系,当前销售id:{},当前客户id:{}",selectByUserId.getCompanyUserId(),param.getUserId());
+                throw new CustomException("请添加分享销售企微好友!");
+            }
+            if (!selectByUserId.getId().equals(param.getCollectionId())) {
+                throw new CustomException("已有信息采集信息!,请联系销售重新分享二维码!");
+            }
+        }
 
         FsUserInformationCollection map = new FsUserInformationCollection();
         map.setUserId(param.getUserId());