From a82f0830a132be063a63dcd7dd2ccca2179d5738 Mon Sep 17 00:00:00 2001
From: zhangzhengmei <zhangzhengmei@prec-tech.com>
Date: 星期日, 06 八月 2023 10:46:38 +0800
Subject: [PATCH] QISPDF课题修改同步
---
force-app/main/default/classes/QISTrigger.cls | 92 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 92 insertions(+), 0 deletions(-)
diff --git a/force-app/main/default/classes/QISTrigger.cls b/force-app/main/default/classes/QISTrigger.cls
index ed06e17..b20f822 100644
--- a/force-app/main/default/classes/QISTrigger.cls
+++ b/force-app/main/default/classes/QISTrigger.cls
@@ -95,6 +95,98 @@
qr.Photo_4_Text__c = phtTxt;
QIS_Ids.add(qr.Id);
}
+
+
+
+ //鍔�4涓瓧娈� 20230627
+ // Photo5
+ if (Trigger.isInsert && String.isBlank(qr.Photo_5__c) == false
+ || (Trigger.isUpdate && ((QIS_Report__c) oldMap.get(qr.Id)).Photo_5__c != qr.Photo_5__c)
+ || (Trigger.isUpdate && String.isBlank(qr.Photo_5__c) == false && String.isBlank(qr.Photo_5_Text__c))
+ ) {
+ String phtTxt = '';
+ if (String.isBlank(qr.Photo_5__c) == false) {
+ Integer pStt = qr.Photo_5__c.indexOf('<img');
+ if (pStt >= 0) {
+ pStt = qr.Photo_5__c.indexOf('src="');
+ if (pStt >= 0) {
+ Integer pEnd = qr.Photo_5__c.indexOf('"', pStt + 5);
+ if (pEnd >= 0) {
+ phtTxt = qr.Photo_5__c.substring(pStt + 5, pEnd);
+ phtTxt = phtTxt.unescapeHtml4();
+ }
+ }
+ }
+ }
+ qr.Photo_5_Text__c = phtTxt;
+ QIS_Ids.add(qr.Id);
+ }
+ // Photo6
+ if (Trigger.isInsert && String.isBlank(qr.Photo_6__c) == false
+ || (Trigger.isUpdate && ((QIS_Report__c) oldMap.get(qr.Id)).Photo_6__c != qr.Photo_6__c)
+ || (Trigger.isUpdate && String.isBlank(qr.Photo_6__c) == false && String.isBlank(qr.Photo_6_Text__c))
+ ) {
+ String phtTxt = '';
+ if (String.isBlank(qr.Photo_6__c) == false) {
+ Integer pStt = qr.Photo_6__c.indexOf('<img');
+ if (pStt >= 0) {
+ pStt = qr.Photo_6__c.indexOf('src="');
+ if (pStt >= 0) {
+ Integer pEnd = qr.Photo_6__c.indexOf('"', pStt + 5);
+ if (pEnd >= 0) {
+ phtTxt = qr.Photo_6__c.substring(pStt + 5, pEnd);
+ phtTxt = phtTxt.unescapeHtml4();
+ }
+ }
+ }
+ }
+ qr.Photo_6_Text__c = phtTxt;
+ QIS_Ids.add(qr.Id);
+ }
+ // Photo7
+ if (Trigger.isInsert && String.isBlank(qr.Photo_7__c) == false
+ || (Trigger.isUpdate && ((QIS_Report__c) oldMap.get(qr.Id)).Photo_7__c != qr.Photo_7__c)
+ || (Trigger.isUpdate && String.isBlank(qr.Photo_7__c) == false && String.isBlank(qr.Photo_7_Text__c))
+ ) {
+ String phtTxt = '';
+ if (String.isBlank(qr.Photo_7__c) == false) {
+ Integer pStt = qr.Photo_7__c.indexOf('<img');
+ if (pStt >= 0) {
+ pStt = qr.Photo_7__c.indexOf('src="');
+ if (pStt >= 0) {
+ Integer pEnd = qr.Photo_7__c.indexOf('"', pStt + 5);
+ if (pEnd >= 0) {
+ phtTxt = qr.Photo_7__c.substring(pStt + 5, pEnd);
+ phtTxt = phtTxt.unescapeHtml4();
+ }
+ }
+ }
+ }
+ qr.Photo_7_Text__c = phtTxt;
+ QIS_Ids.add(qr.Id);
+ }
+ // Photo8
+ if (Trigger.isInsert && String.isBlank(qr.Photo_8__c) == false
+ || (Trigger.isUpdate && ((QIS_Report__c) oldMap.get(qr.Id)).Photo_8__c != qr.Photo_8__c)
+ || (Trigger.isUpdate && String.isBlank(qr.Photo_8__c) == false && String.isBlank(qr.Photo_8_Text__c))
+ ) {
+ String phtTxt = '';
+ if (String.isBlank(qr.Photo_8__c) == false) {
+ Integer pStt = qr.Photo_8__c.indexOf('<img');
+ if (pStt >= 0) {
+ pStt = qr.Photo_8__c.indexOf('src="');
+ if (pStt >= 0) {
+ Integer pEnd = qr.Photo_8__c.indexOf('"', pStt + 5);
+ if (pEnd >= 0) {
+ phtTxt = qr.Photo_8__c.substring(pStt + 5, pEnd);
+ phtTxt = phtTxt.unescapeHtml4();
+ }
+ }
+ }
+ }
+ qr.Photo_8_Text__c = phtTxt;
+ QIS_Ids.add(qr.Id);
+ }
}
}
}
\ No newline at end of file
--
Gitblit v1.9.1