高章伟
2022-02-18 8b5f4c6c281cfa548f92de52c8021e37aa81901e
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
global class QistoSPOWebService {
 
    WebService static String sendSPO(String qrId) {
        List<QIS_Report__c> qrc = [SELECT
                                    Id,
                                    Name,
                                    IsSendQIS__c
                            FROM
                                    QIS_Report__c
                            WHERE
                                    Id = : qrId
                            FOR UPDATE];
        if(qrc == null || qrc.size() == 0){
            return '没有QIS:' + qrId + '的数据。';
        }
        Savepoint sp = Database.setSavepoint();
        try {
            qrc[0].IsSendQIS__c = true;
            UPDATE qrc;
            return 'OK';
        } catch (Exception e) {
            Database.rollback(sp);
            throw e;
        }
    }
}