//
|
// Source code recreated from a .class file by IntelliJ IDEA
|
// (powered by FernFlower decompiler)
|
//
|
|
package com.flow.quartz;
|
|
import com.flow.pojo.Card;
|
import com.flow.pojo.Company;
|
import com.flow.service.CardService;
|
import com.flow.service.CompanyService;
|
import com.flow.util.DESUtil;
|
import com.tencentcloudapi.common.Credential;
|
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
import com.tencentcloudapi.common.profile.ClientProfile;
|
import com.tencentcloudapi.common.profile.HttpProfile;
|
import com.tencentcloudapi.sms.v20210111.SmsClient;
|
import com.tencentcloudapi.sms.v20210111.models.SendSmsRequest;
|
import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
|
import java.util.List;
|
import java.util.concurrent.TimeUnit;
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
public class MyJob3 {
|
private String SecretId = "AKIDrjZOI4e6KLZu9FAsSRN8eOwSt52lbMBz";
|
private String SecretKey = "xnRtHUL3YqdMyOLVSBjKkz1pQoxujS4d";
|
@Autowired
|
CardService cardService;
|
@Autowired
|
CompanyService companyService;
|
|
public MyJob3() {
|
}
|
|
private void execute1() throws Exception {
|
List<Company> companies = this.companyService.findLength();
|
|
for(int i = 0; i < companies.size(); ++i) {
|
TimeUnit.SECONDS.sleep(10L);
|
String GsMc = ((Company)companies.get(i)).getCompanyname();
|
String GsPhone = DESUtil.decrypt(((Company)companies.get(i)).getPhone(), DESUtil.key);
|
System.out.println(GsPhone);
|
List<Card> cardList = this.cardService.findDaoQi1(GsMc);
|
String cardNum = "";
|
if (cardList.size() == 0) {
|
break;
|
}
|
|
for(int j = 0; j < cardList.size(); ++j) {
|
if (j == cardList.size() - 1) {
|
cardNum = cardNum + ((Card)cardList.get(j)).getCardnumber();
|
} else {
|
cardNum = cardNum + ((Card)cardList.get(j)).getCardnumber() + ";";
|
}
|
}
|
|
try {
|
Credential cred = new Credential(this.SecretId, this.SecretKey);
|
HttpProfile httpProfile = new HttpProfile();
|
httpProfile.setEndpoint("sms.tencentcloudapi.com");
|
ClientProfile clientProfile = new ClientProfile();
|
clientProfile.setHttpProfile(httpProfile);
|
SmsClient client = new SmsClient(cred, "ap-beijing", clientProfile);
|
SendSmsRequest req = new SendSmsRequest();
|
String[] phoneNumberSet1 = new String[]{GsPhone};
|
req.setPhoneNumberSet(phoneNumberSet1);
|
req.setSmsSdkAppId("1400838975");
|
req.setSignName("北京华星北斗智控");
|
req.setTemplateId("1878633");
|
String[] templateParamSet1 = new String[]{cardNum};
|
req.setTemplateParamSet(templateParamSet1);
|
SendSmsResponse resp = client.SendSms(req);
|
System.out.println(SendSmsResponse.toJsonString(resp));
|
} catch (TencentCloudSDKException var15) {
|
System.out.println(var15.toString());
|
}
|
}
|
|
}
|
}
|