main
parent
f0bebb23be
commit
586681660a
|
|
@ -279,15 +279,7 @@ public class AppUserServiceImpl implements IAppUserService {
|
|||
entity.setSchool(appUser.getSchool());
|
||||
entity.setSearch(appUser.getSearch());
|
||||
// 学校
|
||||
List<AppUserDataVo> schoolList = new ArrayList<>();
|
||||
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);
|
||||
}
|
||||
List<AppUserDataVo> schoolList = appUserMapper.selectList(entity);
|
||||
Collections.shuffle(schoolList);
|
||||
if (schoolList.size() > limit) {
|
||||
schoolList = schoolList.subList(0, limit);
|
||||
|
|
@ -298,7 +290,12 @@ public class AppUserServiceImpl implements IAppUserService {
|
|||
entity.setSchool(null);
|
||||
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);
|
||||
if (companylList.size() > limit) {
|
||||
companylList = companylList.subList(0, limit);
|
||||
|
|
@ -307,6 +304,11 @@ public class AppUserServiceImpl implements IAppUserService {
|
|||
|
||||
// 好友的好友
|
||||
List<AppUserDataVo> friendList = null;
|
||||
if (StringUtils.isNotBlank(appUser.getSearch())) {
|
||||
AppUser user = new AppUser();
|
||||
user.setSearch(appUser.getSearch());
|
||||
friendList = appUserMapper.selectListByName(user);
|
||||
} else {
|
||||
if (ids == null || ids.size() == 0) {
|
||||
friendList = new ArrayList<>();
|
||||
} else {
|
||||
|
|
@ -317,12 +319,13 @@ public class AppUserServiceImpl implements IAppUserService {
|
|||
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());
|
||||
}
|
||||
appUserNetVo.setFriendUserList(friendList);
|
||||
appUserNetVo.setSchoolUserList(schoolList);
|
||||
appUserNetVo.setCompanyUserList(companylList);
|
||||
|
|
|
|||
|
|
@ -157,9 +157,7 @@ public class SendNoteUtil {
|
|||
String homeTem = "SMS_467520300";
|
||||
String foreignTem = "SMS_468380559";
|
||||
if (!isChineseMobileNumber(PhoneNumber)) {
|
||||
Random random = new Random();
|
||||
String randomNumber = String.valueOf(random.nextInt(9000) + 1000);
|
||||
return sendForeign(PhoneNumber,randomNumber);
|
||||
return sendMessageForeign(PhoneNumber);
|
||||
}
|
||||
CommonRequest request = new CommonRequest();
|
||||
request.setSysMethod(MethodType.POST);
|
||||
|
|
@ -200,7 +198,7 @@ public class SendNoteUtil {
|
|||
request.putQueryParameter("Message", "您的验证码是" + code + "。请不要把验证码泄露给其他人。");
|
||||
//request.putQueryParameter("From", "18773124359");
|
||||
request.putQueryParameter("From", "18773124359");
|
||||
request.putQueryParameter("Type", "OTP");
|
||||
request.putQueryParameter("Type", "OTP");//
|
||||
|
||||
try {
|
||||
CommonResponse response = client.getCommonResponse(request);
|
||||
|
|
@ -241,8 +239,35 @@ public class SendNoteUtil {
|
|||
String phone = "1+4049014566";
|
||||
if (!isChineseMobileNumber(phone)) {
|
||||
phone = phone.replace("+","");
|
||||
System.out.println(phone);
|
||||
System.out.println(sendForeign(phone,"1234"));
|
||||
System.out.println(sendMessageForeign(phone));
|
||||
}
|
||||
}
|
||||
|
||||
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