force-app/main/default/classes/NFM705Rest.cls
@@ -25,7 +25,7 @@
        public String Num; //会议编码 == Num__c
        public String StartDate; //开始日期 == StartDate
        public String EndDate; //结束日期 == EndDate
        public String BudgetType; //预算类型 == Budget_Type__c
        public String BudgetType; //预算类型 == Implementation_Purpose__c
        public String OfficeCategory; //科室分类 == OfficeCategory__c
        public String MeetingType; //会议类型 == Meeting_Type__c   
        public String StateMaster; //省 == State_Master__c
@@ -163,7 +163,7 @@
                aca.Num__c                          = ged.Num;
                aca.StartDate__c                    = NFMUtil.parseDateTimeStr2Date(ged.StartDate);
                aca.EndDate__c                      = NFMUtil.parseDateTimeStr2Date(ged.EndDate);
                aca.BudgetType__c                   = ged.BudgetType;
                aca.Implementation_Purpose1__c                   = ged.BudgetType;
                aca.OfficeCategory__c               = GetOfficeCategory(ged.OfficeCategory, transferMap, iflog);
                //aca.MeetingType__c                  = ged.MeetingType;
                aca.MeetingType__c                  = DividingTypes(ged.IsCoOrganizingActivities,ged.ActivityTypeName);
@@ -188,7 +188,9 @@
                    aca.Id = oldacfcMap.get(ged.MeetingApprovedNo).Id;
                    aca.Num__c = String.isBlank(aca.Num__c) ? oldacfcMap.get(ged.MeetingApprovedNo).Num__c : aca.Num__c; 
                } 
                NumList.add(aca.Num__c);
                if (String.isNotBlank(aca.Num__c)) {
                    NumList.add(aca.Num__c);
                }
                system.debug('NumList------------->'+NumList);
                // 确认申请人
                System.debug('aca.Id: ' + aca.Id);
@@ -208,13 +210,19 @@
            }
            List<Campaign> campaignList = NumList.size() > 0 ? [select Id, 
                                            Num__c, 
                                            MeetingApprovedNo__c
                                            MeetingApprovedNo__c,
                                            State_Master__c,
                                            City_Master__c,
                                            WorkshopPlace__c,
                                            RecordTypeId,
                                            Meeting_Type__c
                                        from Campaign 
                                        where Num__c IN: NumList 
                                        ] : new List<Campaign>();
            // 查找所有人
            if (user_nos != null && user_nos.size() > 0) {
                users = [select Id, Employee_No__c from User where Employee_No__c in :user_nos];
                // 2022-03-23 紧急修复 未启用的用户无法设置共享
                users = [select Id, Employee_No__c from User where Employee_No__c in :user_nos and IsActive = true];
                if (users != null && users.size() > 0) {
                    String owner = '';
                    for (Application_for_Conference_Adjudication__c app : acaList) {
@@ -256,6 +264,7 @@
                // }
                // 更新已存在的决裁信息
                System.debug('查找到的会议: ' + campaignList.size());
                System.debug('lt123查找到的会议:--- ' + campaignList);
                if (campaignList != null && campaignList.size() > 0) {
                    List<Campaign> updatelist = new List<Campaign>();
                    for (Campaign cam : campaignList) {
@@ -264,13 +273,28 @@
                                cam.MeetingApprovedNo__c             = app.MeetingApprovedNo__c;
                                cam.Meeting_Approved_No__c           = app.Id;
                                if (app.MeetingType__c != '赞助会') {
                                    cam.StartDate                        = app.StartDate__c;
                                    cam.EndDate                          = app.EndDate__c;
                                    cam.Budget_Type__c                   = app.BudgetType__c;
                                    //20221206 lt DB202212060256 start
                                    Id RtId = Schema.SObjectType.Campaign.getRecordTypeInfosByDeveloperName().get('Society').getRecordTypeId();
                                    Id RtId2 = Schema.SObjectType.Campaign.getRecordTypeInfosByDeveloperName().get('BusinessTraining').getRecordTypeId();
                                    if(cam.RecordTypeId == RtId || cam.RecordTypeId == RtId2){
                                        if (cam.Meeting_Type__c != '主办会'){
                                            cam.StartDate                        = app.StartDate__c;
                                            cam.EndDate                          = app.EndDate__c;
                                        }
                                    }
                                    if(cam.RecordTypeId != RtId && cam.RecordTypeId != RtId2){
                                        cam.StartDate                        = app.StartDate__c;
                                        cam.EndDate                          = app.EndDate__c;
                                    }
                                    // cam.StartDate                        = app.StartDate__c;
                                    // cam.EndDate                          = app.EndDate__c;
                                    //20221206 lt DB202212060256 end
                                    cam.Implementation_Purpose__c                   = app.Implementation_Purpose1__c;
                                    cam.OfficeCategory__c                = app.OfficeCategory__c;
                                    cam.Meeting_Type__c                  = app.MeetingType__c;
    
                                    cam.WorkshopPlace__c                 = app.WorkshopPlace__c;
                                    cam.WorkshopPlace__c                 = String.isNotBlank(app.WorkshopPlace__c) ? app.WorkshopPlace__c : cam.WorkshopPlace__c;
                                    cam.HostName__c                      = app.HostName__c;
                                    cam.cooperatorCompany__c             = app.CooperatorCompany__c;
                                    cam.Convening_Participants_Num__c    = app.ConveningParticipantsNum__c;
@@ -283,8 +307,8 @@
                                    // cam.Activity_Type_Name__c            = app.ActivityTypeName__c;
                                    cam.Activity_Type_Name__c            = app.Type_of_adjudication_meeting__c;
                                    // 这里需要额外加操作
                                    cam.State_Master__c                  = StateCityUtil.get_state(app.StateMaster__c);
                                    cam.City_Master__c                   = StateCityUtil.get_city(app.CityMaster__c);
                                    cam.State_Master__c                  = String.isNotBlank(app.StateMaster__c) ? StateCityUtil.get_state(app.StateMaster__c) : cam.State_Master__c;
                                    cam.City_Master__c                   = String.isNotBlank(app.CityMaster__c)  ? StateCityUtil.get_city(app.CityMaster__c) : cam.City_Master__c;
                                }
                                
@@ -428,7 +452,7 @@
    //     cam.Meeting_Approved_No__c           = app.Id;
    //     cam.StartDate                        = app.StartDate__c;
    //     cam.EndDate                          = app.EndDate__c;
    //     cam.Budget_Type__c                   = app.BudgetType__c;
    //     cam.Implementation_Purpose__c                   = app.Implementation_Purpose1__c;
    //     cam.OfficeCategory__c                = app.OfficeCategory__c;
    //     cam.Meeting_Type__c                  = app.MeetingType__c;
    //     cam.Activity_Type_Name__c            = app.ActivityTypeName__c;
@@ -509,6 +533,8 @@
        }
        // 再新增
        if (insert_list != null && insert_list.size() > 0) {
            System.debug('insert_list is: ');
            System.debug(insert_list);
            insert insert_list;
        }
    }