From bc11d6edd670912d12da2435d696ff69656ec359 Mon Sep 17 00:00:00 2001
From: KKbes <1620284052@qq.com>
Date: 星期五, 28 七月 2023 17:59:45 +0800
Subject: [PATCH] button
---
force-app/main/default/classes/LexSubmitCampaignController.cls | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 166 insertions(+), 5 deletions(-)
diff --git a/force-app/main/default/classes/LexSubmitCampaignController.cls b/force-app/main/default/classes/LexSubmitCampaignController.cls
index cb77566..8b97e05 100644
--- a/force-app/main/default/classes/LexSubmitCampaignController.cls
+++ b/force-app/main/default/classes/LexSubmitCampaignController.cls
@@ -15,15 +15,17 @@
}
@AuraEnabled
- public static void newAndUpddateCampaign(String Id,String Status){
+ public static String newAndUpddateCampaign(String Id,String Status){
try{
Campaign res = new Campaign();
res.Id = Id;
res.Status=Status;
update res;
+ return 'success';
}
catch(Exception e){
System.debug('lexSubmitCampaign,method:newAndUpddateCampaign error: '+e.getMessage());
+ return e.getMessage();
}
@@ -100,8 +102,8 @@
}
catch (Exception e) {
System.debug('lexSubmitCampaign,method:initCancle error: '+e.getMessage());
- }
- return res;
+ return null;
+ }
}
@AuraEnabled
@@ -118,11 +120,170 @@
System.debug('lexSubmitCampaign,method:initCancle error: '+e.getMessage());
return e.getMessage();
}
- return 'success';
+ }
+ //鏃堕棿淇敼鐢宠鎸夐挳
+ @AuraEnabled
+ public static Campaign initUpdateTimeReply(String recordId){
+ Campaign res = [SELECT Id,Status_Service__c,ServiceDesignDep__c
+ FROM Campaign
+ WHERE Id = : recordId];
+ return res;
}
-
+ @AuraEnabled
+ public static String getUserNameById(String Id){
+ User res = [SELECT Name From User WHERE Id = : Id ];
+ return res.Name;
+ }
+ //鍚戞櫤鎱у尰鐤楀彂閫佹椿鍔ㄤ俊鎭�
+ @AuraEnabled
+ public static Campaign initSendToComPlat(String recordId){
+ Campaign res = [SELECT Id,IF_Submit__c
+ FROM Campaign
+ WHERE Id = : recordId];
+ return res;
+ }
+
+ @AuraEnabled
+ public static String SendToComPlatUpdate(String Id , Boolean IF_Submit){
+ Campaign res= new Campaign();
+ try {
+ res.Id=Id;
+ res.IF_Submit__c=IF_Submit;
+ UPDATE res;
+ return 'success';
+ }
+ catch (Exception e) {
+ System.debug('lexSubmitCampaign,method:initCancle error: '+e.getMessage());
+ return e.getMessage();
+ }
+ }
+ //娣诲姞鍒版棩鍘嗘寜閽�
+ @AuraEnabled
+ public static Campaign initAddToCalender(String recordId){
+ Campaign res = new Campaign();
+ try {
+ res = [SELECT Name,Id,StartDate,EndDate
+ FROM Campaign
+ WHERE Id = : recordId];
+ return res;
+ }
+ catch (Exception e) {
+ System.debug('lexSubmitCampaign,method:initAddToCalender error: '+e.getMessage());
+ return null;
+ }
+ }
+
+ @AuraEnabled
+ public static List<Event> getCampaignEvent(String Id, String userId){
+ try {
+ List<Event> res = [SELECT Id FROM Event WHERE whatId = :Id and WS_flg__c = true and OwnerId = :userId];
+ return res;
+ }
+ catch (Exception e) {
+ System.debug('lexSubmitCampaign,method:getCampaignEvent error: '+e.getMessage());
+ return null;
+ }
+
+ }
+
+ @AuraEnabled
+ public static String addCampaignEvent(Date StartDateTime,Date EndDateTime,String whatid,String Subject){
+ try {
+ Event event = new Event();
+ event.WS_flg__c = true;
+ event.IsAllDayEvent = true;
+ event.StartDateTime = StartDateTime;
+ event.EndDateTime = EndDateTime;
+ event.whatid = whatid;
+ event.Subject = Subject;
+ INSERT event;
+ return 'success';
+ }
+ catch (Exception e) {
+ System.debug('lexSubmitCampaign,method:addCampaignEvent error: '+e.getMessage());
+ return e.getMessage();
+ }
+ }
+
+ //浼氳鍙樻洿鐢宠鍒楄〃鎸夐挳
+ @AuraEnabled
+ public static Campaign initMeetingDelayApply(String recordId){
+ Campaign res = new Campaign();
+ try {
+ res = [SELECT Id,PlanBackData__c,Meeting_Cooperate__c,Meeting_Cooperate2__c,
+ Meeting_Cooperate3__c,Meeting_Cooperate4__c,Meeting_Type__c,HostName__c,
+ cooperatorCompany__c,StartDate,EndDate,IF_Approved__c,Status,CampaignStatus__c,IF_Submit__c,
+ Meeting_Approved_No__c
+ FROM Campaign
+ WHERE Id = :recordId];
+ return res;
+ }
+ catch (Exception e) {
+ System.debug('lexSubmitCampaign,method:initMeetingDelayApply error: '+e.getMessage());
+ return null;
+ }
+ }
+
+ @AuraEnabled
+ public static List<meeting_delay_apply__c> findQualified1(String CampaignId){
+ List<meeting_delay_apply__c> res = new List<meeting_delay_apply__c>();
+ try {
+ res = [SELECT Id FROM meeting_delay_apply__c
+ WHERE Status__c = '瀹℃壒涓�' And Campaign__c =:CampaignId ];
+ return res;
+ }
+ catch (Exception e) {
+ System.debug('lexSubmitCampaign,method:findQualified error: '+e.getMessage());
+ return res;
+ }
+
+ }
+
+ @AuraEnabled
+ public static List<Consum_Apply__c> findQualified2(String CampaignId){
+ List<Consum_Apply__c> res = new List<Consum_Apply__c>();
+ try {
+ res = [SELECT Id FROM Consum_Apply__c
+ WHERE Status__c Not in ('鑽夋涓�','鍙栨秷') And Campaign__c =:CampaignId ];
+ return res;
+ }
+ catch (Exception e) {
+ System.debug('lexSubmitCampaign,method:findQualified error: '+e.getMessage());
+ return res;
+ }
+
+ }
+
+ @AuraEnabled
+ public static List<Rental_Apply__c> findQualified3(String CampaignId){
+ List<Rental_Apply__c> res = new List<Rental_Apply__c>();
+ try {
+ res = [SELECT Id FROM Rental_Apply__c
+ WHERE Status__c Not in ('鑽夋涓�','鍙栨秷') And Campaign__c =:CampaignId ];
+ return res;
+ }
+ catch (Exception e) {
+ System.debug('lexSubmitCampaign,method:findQualified error: '+e.getMessage());
+ return res;
+ }
+
+ }
+
+ @AuraEnabled
+ public static String getRecordIdByName(String Name){
+ try {
+ List<RecordType> res = [Select Id, Name From RecordType Where Name LIKE :Name limit 1];
+ String needId = res[0].Id;
+ return needId;
+ }
+ catch (Exception e) {
+ System.debug('lexSubmitCampaign,method:getRecordIdByName error: '+e.getMessage());
+ return '';
+ }
+
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1