From 1727a4f4d02e429475608e60f142a63bc24127bc Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 23 十月 2023 10:07:34 +0800
Subject: [PATCH] 近期修改
---
force-app/main/default/classes/lexPCLLostReportLwcController.cls | 55 ++++++++++---------------------------------------------
1 files changed, 10 insertions(+), 45 deletions(-)
diff --git a/force-app/main/default/classes/lexPCLLostReportLwcController.cls b/force-app/main/default/classes/lexPCLLostReportLwcController.cls
index 3457411..082f4f8 100644
--- a/force-app/main/default/classes/lexPCLLostReportLwcController.cls
+++ b/force-app/main/default/classes/lexPCLLostReportLwcController.cls
@@ -1,6 +1,6 @@
public with sharing class lexPCLLostReportLwcController {
- public static Product2 pro2 { get; set; }
+
public static string oppId { get; set; }
@@ -19,16 +19,10 @@
public static integer brandNo {get; set;}
- public static integer RemoveBrandNo {get; set;}
-
- public static integer setBrandNo {get; set;}
-
public static integer brandCount {get; set;}
// add tcm 20211122 start
- public static integer topNum {get; set;}
- public static integer secondNum {get; set;}
// add tcm 20211122 end
@AuraEnabled(cacheable=true)
@@ -105,7 +99,7 @@
submitFlag = submitFlag1;
return init1();
} catch (Exception e) {
- return e.getMessage();
+ return new Map<string,object>();
}
}
// 鍒濆鍖�
@@ -211,6 +205,7 @@
Lost_reason_main__c,Lost_Reason_Sub__c,Name,Agency__c, AgencyMannual__c,
Lost_cancel_report__c,Lost_By_Company_Mannual__c,ChannelSpecificReasons__c,
( select id,PCLLostBrand__c,LostProduct__c,
+ isSpec__c,
LostProduct__r.Name,
LostProductMannual__c, //SWAG-C6P9PX lt 20210913 add
ProductCategory__c,
@@ -382,7 +377,7 @@
}
} catch (Exception e) {
- return e.getMessage();
+ return e.getDmlMessage(0);
}
}
// 鏁版嵁褰曞叆
@@ -393,7 +388,7 @@
Map<String,String> messageMap = new Map <String,String>();
system.debug('save---start:');
Savepoint sp = Database.setSavepoint();
- try{
+
// 寰呭畬鎴愶紝杩欓噷闇�瑕佹妸绗竴涓搧鐗岀殑淇℃伅璧嬪�煎埌杩欎釜澶卞崟鎶ュ憡涓婂幓锛岃繕鏈夐渶瑕佹妸鍚勪釜鍝佺墝閲戦姹囨�诲姞璧锋潵锛�
//system.debug('LostReport.LostBrands:'+LostReport.LostBrands);
// 璁剧疆璁板綍绫诲瀷
@@ -562,28 +557,9 @@
// lostReportId = report.lostReport.id;
system.debug('save---end:');
messageMap.put('LostReport',JSON.serialize(report));
- }catch (Exception e) {
- Database.rollback(sp);
- // 杩欓噷闇�瑕佸啓涓�浜涙姤閿欎俊鎭�
- // if (e.getMessage().contains(',')) {
- // System.debug(LoggingLevel.INFO, '*** e: ' + e);
- // String exc = '' + e.getMessage();
- // Integer left = exc.indexOf(':') + 1;
- // Integer right = exc.lastIndexOf(':');
- // String str = exc.substring(left,right);
- // left = str.indexOf(',') + 1;
- // String newStr = str.substring(left);
- // messageMap.put('error', ''+ newStr);
- // }else {
- // messageMap.put('error', ''+ e.getMessage());
- // }
-
- messageMap.put('error', ''+ e.getMessage());
- return messageMap;
- }
+
return messageMap;
}
-
// 鎻愪氦
@AuraEnabled
@@ -634,18 +610,7 @@
return objs;
}catch(exception e) {
Database.rollback(sp);
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- objs.put('error', ''+ newStr);
- }else {
- objs.put('error', ''+ e.getMessage());
- }
+ objs.put('error',e.getDmlMessage(0));
return objs;
}
}
@@ -775,7 +740,7 @@
, ProductCategory__c
from Product2 where Id =:lostProduct];
} catch (Exception e) {
- return e.getMessage();
+ return e.getDmlMessage(0);
}
return JSON.serialize(prd);
}
@@ -799,7 +764,7 @@
Approval.ProcessResult result = Approval.process(req);
return null;
} catch (Exception e) {
- return e.getMessage();
+ return e.getDmlMessage(0);
}
}
@@ -811,7 +776,7 @@
ApprovalHistoryUtil.reassignStep(workItemList, newActorId);
return null;
} catch (Exception e) {
- return e.getMessage();
+ return e.getDmlMessage(0);
}
}
--
Gitblit v1.9.1