From 8475b9f98c8a4c95446f02be4bf2a64e359c359a Mon Sep 17 00:00:00 2001
From: liwentao <1376563863@qq.com>
Date: 星期五, 11 八月 2023 09:10:31 +0800
Subject: [PATCH] 与测试环境对比,部分代码已被人修改,删除其中的alert和部分硬编码,还原测试环境代码逻辑
---
force-app/main/default/classes/AssetModifyBelongsController.cls | 30 +++++++++++++++++-------------
1 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/force-app/main/default/classes/AssetModifyBelongsController.cls b/force-app/main/default/classes/AssetModifyBelongsController.cls
index f832d61..8b89bb5 100644
--- a/force-app/main/default/classes/AssetModifyBelongsController.cls
+++ b/force-app/main/default/classes/AssetModifyBelongsController.cls
@@ -105,7 +105,7 @@
soql = this.makeSoql1('', '');
assetListed = Database.query(soql);
assetListed = noSubmittedList(assetListed);
-
+
if (assetListed.size() > 0) {
ambc.rawAccount__c = assetListed[0].Account.Id;
}
@@ -180,7 +180,8 @@
Map<String, AssetModifyBelongsChangeDetailInfo> MidMap = new Map<String, AssetModifyBelongsChangeDetailInfo>();
List<Asset> asListed = new List<Asset>();
soql = this.makeSoql1(text1, val1);
- asListed = Database.query(soql);
+ System.debug('soql:'+soql);
+ asListed = Database.query(soql);
asListed = noSubmittedList(asListed);
for (AssetModifyBelongsChangeDetailInfo bss : assetModifyBelongsChangeDetailRecordsview) {
if (bss.check == true) {
@@ -224,10 +225,10 @@
Map<String,String> submittedMap = new Map<String,String>();
List<AssetModifyBelongsChangeDetail__c> changeDetailList = new List<AssetModifyBelongsChangeDetail__c>();
// 鏌ユ壘 淇濇湁璁惧鎵�灞炲彉鏇存槑缁�
- changeDetailList = [select Id, Name, Asset__c,Asset__r.Id
+ changeDetailList = [select Id, Name, Asset__c,Asset__r.Id
from AssetModifyBelongsChangeDetail__c
where ChangeAndChangeDetail__c In:ambcIdList];
-
+
if (changeDetailList.size() > 0) {
for(AssetModifyBelongsChangeDetail__c ambcDetail:changeDetailList){
submittedMap.put(ambcDetail.Asset__r.Id, ambcDetail.Asset__r.Id);
@@ -239,9 +240,9 @@
}
}
}
-
+
} else {
- noSubmittedList = asListed;
+ noSubmittedList = asListed;
}
if (noSubmittedList.size() > 200) {
@@ -254,13 +255,13 @@
} else{
break;
}
-
+
}
} else {
asListed = noSubmittedList;
}
}
-
+
return asListed;
// WLIG-BYZ9UF XHL 20210311 End
@@ -271,6 +272,7 @@
val1 = val1.trim();
}
String soql='';
+ //update by liwentao 20230705 start
System.debug(RawAccountId);
RawAccountId='';
if(String.isBlank(RawAccountId)){
@@ -281,6 +283,7 @@
soql = 'select Id,name,SerialNumber,Asset_situation__c,Order_No__c,Account.Name,Status,Installation_Site__c,CurrentContract__c from Asset where AccountId = \'' + RawAccountId + '\'';
System.debug('id is not null');
}
+ //update by liwentao 20230705 start
if (!String.isBlank(text1)) {
if (text1 == 'Order_No__c' && checkexact) {
soql += ' AND (' + text1 + ' = \'' + String.escapeSingleQuotes(val1) + '\' )';
@@ -345,6 +348,7 @@
//璺宠浆鍒颁笂浼犻檮浠堕〉闈�
public PageReference uploadingAttachment() {
PageReference ref = new Pagereference('/p/attach/NoteAttach?pid=' + Id + '&retURL=%2Fapex/AssetModifyBelongs?Id=' + Id);
+
ref.setRedirect(true);
return ref;
}
@@ -353,7 +357,7 @@
public PageReference uploadingAttachmentLightning() {
//PageReference ref = new Pagereference('/p/attach/NoteAttach?pid=' + Id + '&retURL=%2Fapex/AssetModifyBelongs?Id=' + Id);
PageReference ref = new Pagereference('/lightning/n/lightning?backgroundContext=%2Flightning%2Fr%2FAssetModifyBelongsChange__c%2F'+Id+'%2Fedit%3Fcount%3D1&0.recordId='+Id+'');
-
+
ref.setRedirect(true);
return ref;
}
@@ -386,7 +390,7 @@
//鎻愪氦涔嬪墠楠岃瘉淇濇湁璁惧鏄惁鍦ㄥ師瀹㈡埛涓嬶紝涓嶅湪鎶ラ敊銆�
List<AssetModifyBelongsChangeDetail__c> getAmBdList = new List<AssetModifyBelongsChangeDetail__c>();
getAmBdList = [SELECT Id, Name,Asset__r.SerialNumber,AssetNotAccount__c,Asset__r.Account.Name,ChangeAndChangeDetail__r.rawAccount__r.Name
- FROM AssetModifyBelongsChangeDetail__c
+ FROM AssetModifyBelongsChangeDetail__c
WHERE ChangeAndChangeDetail__c = : Id AND AssetNotAccount__c = true];
if (getAmBdList.size() > 0) {
for (AssetModifyBelongsChangeDetail__c ambcd: getAmBdList ) {
@@ -394,11 +398,11 @@
String rawAccountName = ' 涓嶅湪瀹㈡埛 銆� ' + ambcd.ChangeAndChangeDetail__r.rawAccount__r.Name +' 銆� 涓嬶紝';
String accountName = ' 鍦ㄥ鎴� 銆� ' +ambcd.Asset__r.Account.Name +' 銆� 涓嬶紝';
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, serialNumber+rawAccountName+accountName+' 鏃犳硶鎻愪氦锛岃纭'));
-
+
}
return null;
}
-
+
try {
Approval.ProcessSubmitRequest psr = new Approval.ProcessSubmitRequest();
psr.setObjectId(Id);
@@ -628,4 +632,4 @@
}
}
-}
+}
\ No newline at end of file
--
Gitblit v1.9.1