|  |  | 
 |  |  |             boolean defaultFlag = true; | 
 |  |  |             //add     wangweipeng               2021/12/09          end | 
 |  |  |             // 草案中修理だけ更新 | 
 |  |  |             // GZW 特殊处理 跳过维修中心自动赋值,以手选为准 start | 
 |  |  |             // 判断条件追加   && repair.Exc_work_location__c == false | 
 |  |  |             if(repair.Exc_work_location__c){ | 
 |  |  |                 defaultFlag = false; | 
 |  |  |             } | 
 |  |  |             // GZW 特殊处理 跳过维修中心自动赋值,以手选为准 start | 
 |  |  |  | 
 |  |  |             if ((repair.Status__c == '草案中' || String.isBlank(repair.Status__c)) == false) { | 
 |  |  |                 if (Trigger.isUpdate && repair.SAP_Transfer_time__c == null) { | 
 |  |  |                 // if (Trigger.isUpdate && repair.SAP_Transfer_time__c == null) { | 
 |  |  |                 if (Trigger.isUpdate && repair.SAP_Transfer_time__c == null && repair.Exc_work_location__c == false) { | 
 |  |  |                  | 
 |  |  |                     repair = RepairTrigger.updateWorkLocationSelect(repair, null); | 
 |  |  |                     defaultFlag = false; | 
 |  |  |                 } | 
 |  |  | 
 |  |  |  | 
 |  |  |             Boolean needsetnull = true; | 
 |  |  |             System.debug( '-----:自动带出维修合同11111' + middleTableList); | 
 |  |  |             if (middleTableList == null) { | 
 |  |  |             // if (middleTableList == null) { | 
 |  |  |             if (middleTableList == null  && repair.Exc_work_location__c == false) { | 
 |  |  |                 if ((repair.NewProductGuarante_Txt__c == '2: 多年保修' | 
 |  |  |                         || repair.NewProductGuarante_Txt__c == '2: 服务多年保修' | 
 |  |  |                         || repair.NewProductGuarante_Txt__c == '8: 市场多年保修') | 
 |  |  | 
 |  |  |                             repair.repairPlace__c = middleTable.Maintenance_Contract__r.SalesOfficeCode_selection__c; | 
 |  |  |                             //新增逻辑 HWAG-BKP5FB 精琢科技 2020/03/19 Start | 
 |  |  |                             //wangweipeng   发生数据到SAP以后,修理的维修中心不能做修改 | 
 |  |  |                             if(repair.SAP_Transfer_time__c == null){ | 
 |  |  |                             // if(repair.SAP_Transfer_time__c == null){ | 
 |  |  |                             if(repair.SAP_Transfer_time__c == null  && repair.Exc_work_location__c == false){ | 
 |  |  |                                 repair = RepairTrigger.updateWorkLocationSelect(repair, middleTable);     | 
 |  |  |                                 defaultFlag = false; | 
 |  |  |                             } | 
 |  |  | 
 |  |  |             // Boolean needsetnull = true; | 
 |  |  |             System.debug( '-----:自动带出虚拟维修合同'); | 
 |  |  |             System.debug( '-----:自动带出虚拟维修合同' + middleTableVMList); | 
 |  |  |             if (middleTableVMList == null) { | 
 |  |  |             // if (middleTableVMList == null) { | 
 |  |  |             if (middleTableVMList == null  && repair.Exc_work_location__c == false) { | 
 |  |  |                 if ((repair.NewProductGuarante_Txt__c == '2: 多年保修' | 
 |  |  |                         || repair.NewProductGuarante_Txt__c == '2: 服务多年保修' | 
 |  |  |                         || repair.NewProductGuarante_Txt__c == '8: 市场多年保修') | 
 |  |  | 
 |  |  |                         repair.VM_Maintenance_Contract__c = middleTable.Maintenance_Contract__c; | 
 |  |  |                         needsetnull = false; | 
 |  |  |                         //新增逻辑 SLIU-BMMDWK 精琢科技 2020/03/17 Start | 
 |  |  |                         if (repair.VM_Maintenance_Contract__c != null) { | 
 |  |  |                         // if (repair.VM_Maintenance_Contract__c != null) { | 
 |  |  |                         if (repair.VM_Maintenance_Contract__c != null  && repair.Exc_work_location__c == false) { | 
 |  |  |                             repair = RepairTrigger.updateWorkLocationSelect(repair, middleTable); | 
 |  |  |                             defaultFlag = false; | 
 |  |  |                         } |