From 666b1cff3d705a53d07cd3ee6d146a7ef7ac7754 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 26 六月 2023 17:13:11 +0800
Subject: [PATCH] Merge branch 'LEX_chenjingwu_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_chenjingwu_dev

---
 force-app/main/default/classes/lexSolutionProjectRequirementsController.cls |  137 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 137 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls b/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
new file mode 100644
index 0000000..0b4b579
--- /dev/null
+++ b/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
@@ -0,0 +1,137 @@
+public with sharing class lexSolutionProjectRequirementsController {
+    @AuraEnabled
+    public static InitData initSubmitSolutionForApprovalButton(String recordId){
+        InitData res = new InitData();
+        try {
+            SolutionProjectRequirements__c so = [
+                select
+                Status__c,
+                Submit_Date_YouWant__c,
+                CreatedDate,
+                Department_Class__r.Id,
+                Product_Leader__c
+                from SolutionProjectRequirements__c where Id =: recordId
+            ];
+            res.status = so.Status__c;
+            res.submitDateYouWant = so.Submit_Date_YouWant__c;
+            res.createdDate = so.CreatedDate;
+            res.departmentClassId = so.Department_Class__r.Id;
+            res.productLeader = so.Product_Leader__c;
+        } catch (Exception e) {
+            throw new AuraHandledException(e.getMessage());
+        }
+        return res;
+    }
+
+    @AuraEnabled
+    public static InitData initForClosingCaseFlowButton(String recordId){
+        InitData res = new InitData();
+        try {
+            SolutionProjectRequirements__c so = [
+                select
+                Status__c
+                from SolutionProjectRequirements__c where Id =: recordId
+            ]; 
+            res.status = so.Status__c;
+            res.profileId = UserInfo.getProfileId();
+            res.m2ProfileId = lexLightingButtonConstant.M2_PROFILE_NAME;
+        } catch (Exception e) {
+            throw new AuraHandledException(e.getMessage());
+        }
+        return res;
+    }
+
+
+
+    @AuraEnabled
+    public static string updateSubmitSolutionForApprovalButton(String recordId){
+        SolutionProjectRequirements__c so = new SolutionProjectRequirements__c();
+        try {
+            so.Id = recordId;
+            so.Submint_TF__c = true;
+            so.Submitter__c = UserInfo.getUserId();
+            update so;
+            return '';
+        } catch (Exception e) {
+            return e.getMessage();
+        }
+    }
+    @AuraEnabled
+    public static string updateForClosingCaseFlowButton(String recordId){
+        SolutionProjectRequirements__c so = new SolutionProjectRequirements__c();
+        try {
+            so.Id = recordId;
+            so.Status__c = '07缁撴';
+            update so;
+            return '';
+        } catch (Exception e) {
+            return e.getMessage();
+        }
+    }
+
+    @AuraEnabled
+    public static List<Account> queryForAttachments(String Id){
+        List<Account> accList = null;
+        try {
+            accList = [
+                select id,
+                Department_Class__r.OwnerId,
+                Department_Class__r.Owner.SalesManager__c 
+                from Account where id =: Id
+            ];
+            
+        } catch (Exception e) {
+            throw new AuraHandledException(e.getMessage());
+        }
+        return accList;
+    }
+
+    @AuraEnabled
+    public static List<Solution_Programme__c> queryForSolutionProgramme(String recordId){
+        List<Solution_Programme__c> so = new List<Solution_Programme__c>();
+        try {
+            so = [
+                select id,
+                Scheme_Type__c,
+                ApprovalClosingProgramme__c 
+                from Solution_Programme__c where SolutionProjectRequirements__c =: recordId and Scheme_Type__c = '缁撴' 
+            ];
+        } catch (Exception e) {
+            throw new AuraHandledException(e.getMessage());
+        }
+        return so;
+    }
+
+    @AuraEnabled
+    public static List<solutionClosingAttachment__c> queryForAttachments1(String solprogrammeId){
+        List<solutionClosingAttachment__c> so = new List<solutionClosingAttachment__c>();
+        try {
+            so = [
+                select id,name from solutionClosingAttachment__c where Solution_Programme__c =: solprogrammeId
+            ];
+        } catch (Exception e) {
+            throw new AuraHandledException(e.getMessage());
+        }
+        return so;
+    }
+    class InitData{
+        @AuraEnabled
+        public String status;
+        @AuraEnabled
+        public Date submitDateYouWant;
+        @AuraEnabled
+        public Datetime createdDate;
+        @AuraEnabled
+        public String departmentClassId;
+        @AuraEnabled
+        public String userId;
+        @AuraEnabled
+        public String userName;
+        @AuraEnabled
+        public String productLeader;
+        @AuraEnabled
+        public String profileId;
+        @AuraEnabled
+        public String m2ProfileId;
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.1