|
@@ -5,14 +5,20 @@ import com.mokamrp.privates.entity.pangu.GetForsterwxMobileHandle;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxMobile;
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxMobile;
|
|
|
import com.mokamrp.privates.mapper.pangu.FosterwxMobileMapper;
|
|
import com.mokamrp.privates.mapper.pangu.FosterwxMobileMapper;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxMobileWxfriend;
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxMobileWxfriend;
|
|
|
|
|
+import com.mokamrp.privates.mapper.pangu.pojo.FosterwxStationBindBox;
|
|
|
|
|
+import com.mokamrp.privates.mapper.pojo.User;
|
|
|
import com.mokamrp.privates.service.pangu.FosterwxMobileService;
|
|
import com.mokamrp.privates.service.pangu.FosterwxMobileService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.mokamrp.privates.service.pangu.FosterwxMobileWxfriendService;
|
|
import com.mokamrp.privates.service.pangu.FosterwxMobileWxfriendService;
|
|
|
|
|
+import org.apache.tomcat.jni.Local;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.mokamrp.privates.entity.PostBasePageHandle;
|
|
import com.mokamrp.privates.entity.PostBasePageHandle;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
+
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -62,5 +68,60 @@ public class FosterwxMobileServiceImpl extends ServiceImpl<FosterwxMobileMapper,
|
|
|
return resMap;
|
|
return resMap;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 导入数据
|
|
|
|
|
+ * @param row
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ public Boolean importData(List<Map<String,String>> row, User authUser){
|
|
|
|
|
+ if(row.size() <= 0){
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ List<FosterwxMobile> add = new ArrayList<>();
|
|
|
|
|
+ DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ for (int i = 0;i<row.size();i++) {
|
|
|
|
|
+
|
|
|
|
|
+ LocalDateTime nowDate = LocalDateTime.now();
|
|
|
|
|
+ Map<String, String> cell = row.get(i);
|
|
|
|
|
+ FosterwxMobile fosterwxMobile = new FosterwxMobile();
|
|
|
|
|
+ fosterwxMobile.setStationId(Integer.parseInt(row.get(i).get("stationId")));
|
|
|
|
|
+ fosterwxMobile.setMobileCode(Integer.parseInt(row.get(i).get("mobileCode")));
|
|
|
|
|
+ fosterwxMobile.setMobileNo(row.get(i).get("mobileNo"));
|
|
|
|
|
+ fosterwxMobile.setMobileOperator(Integer.parseInt(row.get(i).get("mobileOperator")));
|
|
|
|
|
+ fosterwxMobile.setMobileCreateAt(LocalDateTime.parse(row.get(i).get("mobileCreateAt"),df));
|
|
|
|
|
+ fosterwxMobile.setMobileAdvancePayAmt(Integer.parseInt(row.get(i).get("mobileAdvancePayAmt")));
|
|
|
|
|
+ fosterwxMobile.setMobileCombo(row.get(i).get("mobileCombo"));
|
|
|
|
|
+ fosterwxMobile.setMobileRealName(row.get(i).get("mobileRealName"));
|
|
|
|
|
+ fosterwxMobile.setMobileIdentityCardNo(row.get(i).get("mobileIdentityCardNo"));
|
|
|
|
|
+ fosterwxMobile.setWxPassword(row.get(i).get("wxPassword"));
|
|
|
|
|
+ fosterwxMobile.setWxRegisterAt(LocalDateTime.parse(row.get(i).get("wxRegisterAt")));
|
|
|
|
|
+ fosterwxMobile.setWxRealName(row.get(i).get("wxRealName"));
|
|
|
|
|
+ fosterwxMobile.setWxIdentityCardNo(row.get(i).get("wxIdentityCardNo"));
|
|
|
|
|
+ fosterwxMobile.setBankCardNo(row.get(i).get("bankCardNo"));
|
|
|
|
|
+ fosterwxMobile.setBankCardMobileNo(row.get(i).get("bankCardMobileNo"));
|
|
|
|
|
+ fosterwxMobile.setStationId(Integer.parseInt(row.get(i).get("workWxCorp")));
|
|
|
|
|
+ fosterwxMobile.setStationId(Integer.parseInt(row.get(i).get("workWxRegisterAt")));
|
|
|
|
|
+ fosterwxMobile.setCreateAt(nowDate);
|
|
|
|
|
+ fosterwxMobile.setUpdateAt(nowDate);
|
|
|
|
|
+ add.add(fosterwxMobile);
|
|
|
|
|
+ //.批量录入微信好友
|
|
|
|
|
+ List<FosterwxMobileWxfriend> addFriend = new ArrayList<>();
|
|
|
|
|
+ for (Integer s = 1;s<=3;s++) {
|
|
|
|
|
+ String sStr = s.toString();
|
|
|
|
|
+ FosterwxMobileWxfriend fosterwxMobileWxfriend = new FosterwxMobileWxfriend();
|
|
|
|
|
+ fosterwxMobileWxfriend.setMobileId(fosterwxMobile.getId());
|
|
|
|
|
+ fosterwxMobileWxfriend.setCreateAt(nowDate);
|
|
|
|
|
+ fosterwxMobileWxfriend.setUpdateAt(nowDate);
|
|
|
|
|
+ fosterwxMobileWxfriend.setSeq(s);
|
|
|
|
|
+ fosterwxMobileWxfriend.setWxName(row.get(i).get("wxFriendName"+sStr));
|
|
|
|
|
+ fosterwxMobileWxfriend.setWxUsername(row.get(i).get("wxFriendUserName"+sStr));
|
|
|
|
|
+ addFriend.add(fosterwxMobileWxfriend);
|
|
|
|
|
+ }
|
|
|
|
|
+ fosterwxMobileWxfriendService.remove(new QueryWrapper<FosterwxMobileWxfriend>().eq("mobile_id",fosterwxMobile.getId()));
|
|
|
|
|
+ fosterwxMobileWxfriendService.saveBatch(addFriend);
|
|
|
|
|
+ }
|
|
|
|
|
+ this.saveBatch(add);
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|