19626
2023-04-04 5d155accb594089737a0b4edd753152a1ea66bc4
force-app/main/default/classes/MonthlyReportController.cls
@@ -1,4 +1,5 @@
public with sharing class MonthlyReportController {
    //为取消提交相应的js提供初始化数据
    @AuraEnabled
    public static InitData initForCancelSubmitButton (String recordId){
        InitData res = new initData();
@@ -14,7 +15,7 @@
        return res;
    }
    //为创建notes邮箱操作提供初始化数据
    @AuraEnabled
    public static InitData initForCreateNoteEmailButton (String recordId) {
        InitData res = new initData();
@@ -48,13 +49,13 @@
        }
        return res;
    }
    //取消提交操作更新相应数据
    @AuraEnabled
    public static void cancel(String recordId) {
       try {
        Monthly_Report__c report = [SELECT    Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c FROM Monthly_Report__c WHERE Id = :recordId LIMIT 1];
        report.Status__c = '草案中';
        report.RecordTypeId = '01210000000Qggf';
        report.Status__c = LightingButtonConstant.STATUS_DRAFT;
        report.RecordTypeId =  Schema.SObjectType.Monthly_Report__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_MONTHLY_REPORT).getRecordTypeId();
        report.Submit_check_flag__c = false;
        report.Submit_time__c = null;
        update report;