From 80f74bc1dfbf4a6f2fa358efe027590d2cdb5b99 Mon Sep 17 00:00:00 2001
From: GWY <guweiyiscp096@foxmail.com>
Date: 星期二, 19 四月 2022 10:39:16 +0800
Subject: [PATCH] 代理商公共小组,无影响。
---
force-app/main/default/classes/SWOController.cls | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/force-app/main/default/classes/SWOController.cls b/force-app/main/default/classes/SWOController.cls
index 5c6dbe2..8d92469 100644
--- a/force-app/main/default/classes/SWOController.cls
+++ b/force-app/main/default/classes/SWOController.cls
@@ -32,21 +32,28 @@
public RepairPart__c repairPart{get;set;}
private String SwoStatus;
+ public String staticResource { get; private set; }// 20220313 PI鏀归�� by Chen Yanan
+ public String contactstaticResource { get; private set; }// 20220313 PI鏀归�� by Chen Yanan
+ public String contactAWSDataId { get; private set; }// 20220313 PI鏀归�� by Chen Yanan
+ public Boolean isNew { get; set; }// 20220313 PI鏀归�� by Chen Yanan
//ASSIGNEDTO__c
public SWOController() {
}
public SWOController(ApexPages.StandardController stdController) {
+ isNew = true;
swoid = System.currentPageReference().getParameters().get('id');
caseId = System.currentPageReference().getParameters().get('caseId');
accId = System.currentPageReference().getParameters().get('accId');
conId = System.currentPageReference().getParameters().get('conId');
type = System.currentPageReference().getParameters().get('type');
- System.debug(caseId);
+ staticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('SWO__c'));// 20220313 PI鏀归�� by Chen Yanan
+ contactstaticResource = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));// 20220313 PI鏀归�� by Chen Yanan
}
public void init() {
+
lineCount = 0;
//鑾峰彇鍒濆URL
baseUrl = URL.getSalesforceBaseUrl().toExternalForm();
@@ -66,12 +73,15 @@
User_FaultInfo__c ca = new User_FaultInfo__c();
List<SWO__c> temp = new List<SWO__c>();
if (caseId != null) {
- ca = [select id, NUMBER__c,COMPANY__c,CONTACT__c,SUBJECT__c from User_FaultInfo__c where id = : caseId];
+ // ca = [select id, NUMBER__c,COMPANY__c,CONTACT__c,SUBJECT__c from User_FaultInfo__c where id = : caseId];
+ ca = [select id, NUMBER__c,COMPANY__c,CONTACT__c,SUBJECT__c, CONTACT__r.AWS_Data_Id__c, CONTACT__r.Name, CONTACT__r.Email from User_FaultInfo__c where id = : caseId];// 20220313 PI鏀归�� by Chen Yanan
temp = [select id from SWO__c where CASE_NUMBER__c = :caseId];
+ contactAWSDataId = String.isNotBlank(ca.CONTACT__r.AWS_Data_Id__c)?ca.CONTACT__r.AWS_Data_Id__c:'';
}
System.debug('ca' + ca.NUMBER__c);
System.debug('temp' + temp.size());
if (swoid != null) {
+ isNew = false;// 20220313 PI鏀归�� by Chen Yanan
//鍒濆鍖朣WO
Schema.DescribeSobjectResult d_swo = SWO__c.sObjectType.getDescribe();
Map<String, Schema.SObjectField> d_swo_map = d_swo.fields.getMap();
@@ -83,11 +93,15 @@
}
fields_odr += field;
}
- soql_swo += fields_odr;
+ // soql_swo += fields_odr;
+ soql_swo += fields_odr + ', CONTACT__r.AWS_Data_Id__c, CONTACT__r.Name, CONTACT__r.Email ';// 20220313 PI鏀归�� by Chen Yanan
soql_swo += ' from SWO__c where Id = \'' + swoid + '\'';
+ System.debug('soql_swo: ' + soql_swo);// 20220313 PI鏀归�� by Chen Yanan
List<SWO__c> swoList = Database.query(soql_swo);
+ System.debug('swoList: ' + swoList);// 20220313 PI鏀归�� by Chen Yanan
if (swoList.size() > 0) {
swo = swoList[0];
+ contactAWSDataId = String.isNotBlank(swo.CONTACT__r.AWS_Data_Id__c)?swo.CONTACT__r.AWS_Data_Id__c:'';
}
//鍒濆鍖栬褰昐WO 鍘熷ASSIGNED TO锛屼繚瀛樻椂鍒ゆ柇鐢ㄦ埛鏄惁鍙樻洿锛屽鏋滃彉鏇寸粰鐢ㄦ埛鍙戦�侀偖浠�
assignedUser = swo.ASSIGNEDTO__c;
@@ -168,6 +182,7 @@
swo.CONTACT__c = conId;
}
swo.SWO_STATUS__c = 'Not Started';
+ System.debug('SWO: ' + swo);
}
SwoStatus = swo.SWO_STATUS__c;
}
@@ -266,6 +281,7 @@
// SWOSTATUS_Closed_AddAttachment();//SWOSTATUS_Closed_AddAttachment
// }
}
+ System.debug('swo save:' + swo); // Update By Yanan
if (swoid == null) {
swo.CASE_NUMBER__c = caseId;
insert swo;
--
Gitblit v1.9.1