buli
2023-05-23 07390e2fcb4adf27c928335bf27ae7939c5a80ad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
public with sharing class LexLostSubmitApprovalController {
 
    // 遗失报告 提交待审核
    @AuraEnabled
    public static InitData LexLostSubmitApprovalController(String recordId) {
        InitData res = new initData();
        try{
            List<LostReport_Detail__c> reportDetail = new List<LostReport_Detail__c>();
            LostReport__c report = [SELECT Id,Status__c FROM LostReport__c WHERE Id = :recordId LIMIT 1];
            res.Id = report.Id;
            res.statusTf = report.Status__c;
            reportDetail = [SELECT Rental_Apply_Equipment_Set_Detail__r.Lost_item_check_day__c FROM LostReport_Detail__c WHERE id = :recordId AND Rental_Apply_Equipment_Set_Detail__r.Lost_item_check_day__c != null];
            res.reportDetailList = reportDetail;
            System.debug(LoggingLevel.INFO, '*** zq: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** zq: ' + e);
        }
        return res;
    }
 
    public class InitData{
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public String statusTf;
        @AuraEnabled
        public List<LostReport_Detail__c> reportDetailList;
    }
 
    //提交按钮
    @AuraEnabled
    public static String submit(String recordId) {
       try {
        LostReport__c rac = [SELECT Id,Status__c FROM LostReport__c WHERE Id = :recordId LIMIT 1];
        rac.Id = rac.Id;
        rac.Status__c = '填写完毕';
        update rac;
        return '1';
       } catch (Exception ex) {
        System.debug(LoggingLevel.INFO, '*** zq: ' + ex);
        // return errMsg;
        return ex.getMessage();
       }
    }
}