main
parent
f0bebb23be
commit
586681660a
|
|
@ -279,15 +279,7 @@ public class AppUserServiceImpl implements IAppUserService {
|
||||||
entity.setSchool(appUser.getSchool());
|
entity.setSchool(appUser.getSchool());
|
||||||
entity.setSearch(appUser.getSearch());
|
entity.setSearch(appUser.getSearch());
|
||||||
// 学校
|
// 学校
|
||||||
List<AppUserDataVo> schoolList = new ArrayList<>();
|
List<AppUserDataVo> schoolList = appUserMapper.selectList(entity);
|
||||||
if (StringUtils.isBlank(appUser.getSearch())) {
|
|
||||||
schoolList = appUserMapper.selectList(entity);
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(appUser.getSearch())) {
|
|
||||||
AppUser user = new AppUser();
|
|
||||||
user.setSearch(appUser.getSearch());
|
|
||||||
schoolList = appUserMapper.selectListByName(user);
|
|
||||||
}
|
|
||||||
Collections.shuffle(schoolList);
|
Collections.shuffle(schoolList);
|
||||||
if (schoolList.size() > limit) {
|
if (schoolList.size() > limit) {
|
||||||
schoolList = schoolList.subList(0, limit);
|
schoolList = schoolList.subList(0, limit);
|
||||||
|
|
@ -298,7 +290,12 @@ public class AppUserServiceImpl implements IAppUserService {
|
||||||
entity.setSchool(null);
|
entity.setSchool(null);
|
||||||
entity.setCompanyName(appUser.getCompanyName());
|
entity.setCompanyName(appUser.getCompanyName());
|
||||||
// 公司
|
// 公司
|
||||||
List<AppUserDataVo> companylList = appUserMapper.selectList(entity);
|
List<AppUserDataVo> companylList = null;
|
||||||
|
if (StringUtils.isBlank(appUser.getCompanyName())) {
|
||||||
|
companylList = new ArrayList<>();
|
||||||
|
} else {
|
||||||
|
companylList = appUserMapper.selectList(entity);
|
||||||
|
}
|
||||||
Collections.shuffle(companylList);
|
Collections.shuffle(companylList);
|
||||||
if (companylList.size() > limit) {
|
if (companylList.size() > limit) {
|
||||||
companylList = companylList.subList(0, limit);
|
companylList = companylList.subList(0, limit);
|
||||||
|
|
@ -307,22 +304,28 @@ public class AppUserServiceImpl implements IAppUserService {
|
||||||
|
|
||||||
// 好友的好友
|
// 好友的好友
|
||||||
List<AppUserDataVo> friendList = null;
|
List<AppUserDataVo> friendList = null;
|
||||||
if (ids == null || ids.size() == 0) {
|
if (StringUtils.isNotBlank(appUser.getSearch())) {
|
||||||
friendList = new ArrayList<>();
|
AppUser user = new AppUser();
|
||||||
|
user.setSearch(appUser.getSearch());
|
||||||
|
friendList = appUserMapper.selectListByName(user);
|
||||||
} else {
|
} else {
|
||||||
List<Long> friendIds = appUserFriendMapper.selectByFriendId(ids);
|
if (ids == null || ids.size() == 0) {
|
||||||
entity.setFriendIds(friendIds);
|
|
||||||
entity.setCompanyName(null);
|
|
||||||
friendList = appUserMapper.selectList(entity);
|
|
||||||
if (friendList == null || friendList.size() == 0) {
|
|
||||||
friendList = new ArrayList<>();
|
friendList = new ArrayList<>();
|
||||||
|
} else {
|
||||||
|
List<Long> friendIds = appUserFriendMapper.selectByFriendId(ids);
|
||||||
|
entity.setFriendIds(friendIds);
|
||||||
|
entity.setCompanyName(null);
|
||||||
|
friendList = appUserMapper.selectList(entity);
|
||||||
|
if (friendList == null || friendList.size() == 0) {
|
||||||
|
friendList = new ArrayList<>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Collections.shuffle(friendList);
|
|
||||||
if (friendList.size() > limit) {
|
|
||||||
friendList = friendList.subList(0, limit);
|
|
||||||
}
|
|
||||||
friendList.sort(Comparator.comparingLong(AppUserDataVo::getFansNum).reversed());
|
|
||||||
}
|
}
|
||||||
|
Collections.shuffle(friendList);
|
||||||
|
if (friendList.size() > limit) {
|
||||||
|
friendList = friendList.subList(0, limit);
|
||||||
|
}
|
||||||
|
friendList.sort(Comparator.comparingLong(AppUserDataVo::getFansNum).reversed());
|
||||||
appUserNetVo.setFriendUserList(friendList);
|
appUserNetVo.setFriendUserList(friendList);
|
||||||
appUserNetVo.setSchoolUserList(schoolList);
|
appUserNetVo.setSchoolUserList(schoolList);
|
||||||
appUserNetVo.setCompanyUserList(companylList);
|
appUserNetVo.setCompanyUserList(companylList);
|
||||||
|
|
|
||||||
|
|
@ -157,9 +157,7 @@ public class SendNoteUtil {
|
||||||
String homeTem = "SMS_467520300";
|
String homeTem = "SMS_467520300";
|
||||||
String foreignTem = "SMS_468380559";
|
String foreignTem = "SMS_468380559";
|
||||||
if (!isChineseMobileNumber(PhoneNumber)) {
|
if (!isChineseMobileNumber(PhoneNumber)) {
|
||||||
Random random = new Random();
|
return sendMessageForeign(PhoneNumber);
|
||||||
String randomNumber = String.valueOf(random.nextInt(9000) + 1000);
|
|
||||||
return sendForeign(PhoneNumber,randomNumber);
|
|
||||||
}
|
}
|
||||||
CommonRequest request = new CommonRequest();
|
CommonRequest request = new CommonRequest();
|
||||||
request.setSysMethod(MethodType.POST);
|
request.setSysMethod(MethodType.POST);
|
||||||
|
|
@ -200,7 +198,7 @@ public class SendNoteUtil {
|
||||||
request.putQueryParameter("Message", "您的验证码是" + code + "。请不要把验证码泄露给其他人。");
|
request.putQueryParameter("Message", "您的验证码是" + code + "。请不要把验证码泄露给其他人。");
|
||||||
//request.putQueryParameter("From", "18773124359");
|
//request.putQueryParameter("From", "18773124359");
|
||||||
request.putQueryParameter("From", "18773124359");
|
request.putQueryParameter("From", "18773124359");
|
||||||
request.putQueryParameter("Type", "OTP");
|
request.putQueryParameter("Type", "OTP");//
|
||||||
|
|
||||||
try {
|
try {
|
||||||
CommonResponse response = client.getCommonResponse(request);
|
CommonResponse response = client.getCommonResponse(request);
|
||||||
|
|
@ -241,8 +239,35 @@ public class SendNoteUtil {
|
||||||
String phone = "1+4049014566";
|
String phone = "1+4049014566";
|
||||||
if (!isChineseMobileNumber(phone)) {
|
if (!isChineseMobileNumber(phone)) {
|
||||||
phone = phone.replace("+","");
|
phone = phone.replace("+","");
|
||||||
System.out.println(phone);
|
System.out.println(sendMessageForeign(phone));
|
||||||
System.out.println(sendForeign(phone,"1234"));
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String sendMessageForeign(String phone){
|
||||||
|
DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou","LTAI5tQMf7PG2rH4U2mZBQnK", "3l8t7cVJGTGGu89AepWtq0CddgZNfU");
|
||||||
|
IAcsClient client = new DefaultAcsClient(profile);
|
||||||
|
CommonRequest request = new CommonRequest();
|
||||||
|
request.setSysMethod(MethodType.POST);
|
||||||
|
request.setSysDomain("dysmsapi.aliyuncs.com");
|
||||||
|
request.setSysVersion("2017-05-25");
|
||||||
|
request.setSysAction("SendMessageToGlobe");
|
||||||
|
request.putQueryParameter("To", phone);
|
||||||
|
request.putQueryParameter("Message", "尊敬的" + phone +"用户,您的申请已通过,请使用您的手机号登录\n");
|
||||||
|
request.putQueryParameter("From", "18338560758");
|
||||||
|
request.putQueryParameter("Type", "NOTIFY");
|
||||||
|
|
||||||
|
try {
|
||||||
|
CommonResponse response = client.getCommonResponse(request);
|
||||||
|
String returnStr = response.getData();
|
||||||
|
System.out.println(returnStr);
|
||||||
|
String data = response.getData();
|
||||||
|
return JSONObject.parseObject(data).getString("Code");
|
||||||
|
} catch (ServerException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return e.getErrMsg();
|
||||||
|
} catch (ClientException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return e.getErrMsg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue