|
|
@@ -1,6 +1,8 @@
|
|
|
package com.mokamrp.privates.tast.pangu;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.mokamrp.privates.constant.RedisKey;
|
|
|
import com.mokamrp.privates.entity.ResHandle;
|
|
|
@@ -51,29 +53,29 @@ public class SyncFosterwxMobile {
|
|
|
this.fosterwxMobileList = fosterwxMobileService.list();
|
|
|
//.查询所有账号下微信好友
|
|
|
this.fosterwxMobileWxfriendList = fosterwxMobileWxfriendService.list();
|
|
|
- Map<String,List<FosterwxMobile>> add = new HashMap<>();
|
|
|
- for (FosterwxMobile fosterwxMobile : this.fosterwxMobileList){
|
|
|
+ Map<String, List<FosterwxMobile>> add = new HashMap<>();
|
|
|
+ for (FosterwxMobile fosterwxMobile : this.fosterwxMobileList) {
|
|
|
Integer stationId = fosterwxMobile.getStationId();
|
|
|
List<FosterwxMobile> data = new ArrayList<>();
|
|
|
- if (add.get(stationId.toString()) == null || add.get(stationId.toString()).isEmpty()){
|
|
|
+ if (add.get(stationId.toString()) == null || add.get(stationId.toString()).isEmpty()) {
|
|
|
data = new ArrayList<FosterwxMobile>();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
data = add.get(stationId.toString());
|
|
|
}
|
|
|
List<FosterwxMobileWxfriend> friends = this.getMobileWxfriendByMobileId(fosterwxMobile.getId());
|
|
|
- fosterwxMobile.setFriends(friends);
|
|
|
+ fosterwxMobile.setFriend(friends);
|
|
|
data.add(fosterwxMobile);
|
|
|
- add.put(stationId.toString(),data);
|
|
|
+ add.put(stationId.toString(), data);
|
|
|
}
|
|
|
- for(Map.Entry<String,List<FosterwxMobile>> entry : add.entrySet()){
|
|
|
- stringRedisTemplate.opsForValue().set(RedisKey.PanWxFosterMobileInfo+entry.getKey(),JSON.toJSONString(entry.getValue()));
|
|
|
+ for (Map.Entry<String, List<FosterwxMobile>> entry : add.entrySet()) {
|
|
|
+ stringRedisTemplate.opsForValue().set(RedisKey.PanWxFosterMobileInfo + entry.getKey(), JSONArray.toJSONString(entry.getValue()));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public List<FosterwxMobileWxfriend> getMobileWxfriendByMobileId(Integer mobileId){
|
|
|
+ public List<FosterwxMobileWxfriend> getMobileWxfriendByMobileId(Integer mobileId) {
|
|
|
List<FosterwxMobileWxfriend> res = new ArrayList<FosterwxMobileWxfriend>();
|
|
|
- for (FosterwxMobileWxfriend fosterwxMobileWxfriend : this.fosterwxMobileWxfriendList){
|
|
|
- if (fosterwxMobileWxfriend.getMobileId().equals(mobileId)){
|
|
|
+ for (FosterwxMobileWxfriend fosterwxMobileWxfriend : this.fosterwxMobileWxfriendList) {
|
|
|
+ if (fosterwxMobileWxfriend.getMobileId().equals(mobileId)) {
|
|
|
res.add(fosterwxMobileWxfriend);
|
|
|
}
|
|
|
}
|