| | |
| | | public with sharing class lexPCLLostReportLwcController { |
| | | |
| | | public static Product2 pro2 { get; set; } |
| | | |
| | | |
| | | public static string oppId { get; set; } |
| | | |
| | |
| | | |
| | | 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) |
| | |
| | | submitFlag = submitFlag1; |
| | | return init1(); |
| | | } catch (Exception e) { |
| | | return e.getMessage(); |
| | | return new Map<string,object>(); |
| | | } |
| | | } |
| | | // 初始化 |
| | |
| | | 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, |
| | |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | return e.getMessage(); |
| | | return e.getDmlMessage(0); |
| | | } |
| | | } |
| | | // 数据录入 |
| | |
| | | Map<String,String> messageMap = new Map <String,String>(); |
| | | system.debug('save---start:'); |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try{ |
| | | |
| | | // 待完成,这里需要把第一个品牌的信息赋值到这个失单报告上去,还有需要把各个品牌金额汇总加起来; |
| | | //system.debug('LostReport.LostBrands:'+LostReport.LostBrands); |
| | | // 设置记录类型 |
| | |
| | | // 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 |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | , ProductCategory__c |
| | | from Product2 where Id =:lostProduct]; |
| | | } catch (Exception e) { |
| | | return e.getMessage(); |
| | | return e.getDmlMessage(0); |
| | | } |
| | | return JSON.serialize(prd); |
| | | } |
| | |
| | | Approval.ProcessResult result = Approval.process(req); |
| | | return null; |
| | | } catch (Exception e) { |
| | | return e.getMessage(); |
| | | return e.getDmlMessage(0); |
| | | } |
| | | |
| | | } |
| | |
| | | ApprovalHistoryUtil.reassignStep(workItemList, newActorId); |
| | | return null; |
| | | } catch (Exception e) { |
| | | return e.getMessage(); |
| | | return e.getDmlMessage(0); |
| | | } |
| | | |
| | | } |