fei.wang
2024-03-07 80c20bb65f4b73d8beb817e0d595889cd44479dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//
// 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());
            }
        }
 
    }
}