Forráskód Böngészése

好友和账号关系关联导表验证好友ID是否隶属于站点下

leon 4 éve
szülő
commit
4dac3ad8f4

+ 11 - 0
src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxMobileWxfriendServiceImpl.java

@@ -18,6 +18,7 @@ import com.mokamrp.privates.service.pangu.FosterwxMobileService;
 import com.mokamrp.privates.service.pangu.FosterwxMobileWxfriendService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.mokamrp.privates.service.pangu.FosterwxStationService;
+import com.mokamrp.privates.service.pangu.FosterwxWxfriendService;
 import org.springframework.stereotype.Service;
 import com.mokamrp.privates.entity.PostBasePageHandle;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -48,6 +49,9 @@ public class FosterwxMobileWxfriendServiceImpl extends ServiceImpl<FosterwxMobil
 
     @Autowired
     public FosterwxStationService fosterwxStationService;
+
+    @Autowired
+    public FosterwxWxfriendService fosterwxWxfriendService;
     /**
      * 获取数据列表 支持分页
      * @param handle
@@ -197,6 +201,13 @@ public class FosterwxMobileWxfriendServiceImpl extends ServiceImpl<FosterwxMobil
             if (mobileInfo == null) {
                 throw new Exception("第" + (i + 1) + "行,手机编号:" + mobileCode + ",不存在");
             }
+            FosterwxWxfriend friendInfo = fosterwxWxfriendService.getOne(new QueryWrapper<FosterwxWxfriend>()
+                    .eq("station_id",stationInfo.getId())
+                    .eq("id",row.get(i).get("friendId"))
+            );
+            if (friendInfo == null){
+                throw new Exception("第" + (i + 1) + "行,好友编号:"+row.get(i).get("friendId") + "不是"+stationInfo.getStationName()+"站点下的微信好友,请检查后录入");
+            }
             //.判断是否同账号下重复绑定好友
             Integer hasRecord = this.count(new QueryWrapper<FosterwxMobileWxfriend>()
                     .eq("mobile_id",mobileInfo.getId())