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;
        }
	}
}