| | |
| | | RepairTrigger.UpdateAssert(Trigger.new, Trigger.newMap, Trigger.old, Trigger.oldMap); |
| | | // } |
| | | } |
| | | if( Trigger.isBefore && Trigger.isUpdate){ |
| | | |
| | | } |
| | | // ---------------------------------------------------------------------- |
| | | // ここより、修理のサービスコントラクト項目を自動的に更新するロジック |
| | | // ---------------------------------------------------------------------- |
| | |
| | | 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 && repair.Exc_work_location__c == false) { |
| | |
| | | //如果最大大修次数大于0,并且已经大修次数 大于或等于 最大大修次数,那么不仅不赋值维修合同信息,而且清空当前信息 |
| | | if (middleTable.Series_MaxRepairCount_F__c > 0 && middleTable.Series_RepairCount_F__c >= middleTable.Series_MaxRepairCount_F__c) { |
| | | //不赋值维修合同信息,而且清空当前信息 |
| | | repair.Maintenance_Contract__c = null; |
| | | repair.MaintenanceContractType__c = null; |
| | | //URF限次合同2期 LY 20220926 start |
| | | // repair.Maintenance_Contract__c = null; |
| | | // repair.MaintenanceContractType__c = null; |
| | | repair.Maintenance_Contract__c = middleTable.Maintenance_Contract__c; |
| | | repair.MaintenanceContractType__c = middleTable.Maintenance_Contract__r.RecordType.Name; |
| | | //URF限次合同2期 LY 20220926 end |
| | | } |
| | | } |
| | | //限次合同产品信息维护相关 FXK 2021/03/05 END |
| | | //上限合同 LY 20230117 start |
| | | //如果记录类型是服务任务并且是上限合同,那么判断超过合同上限标志 |
| | | if (middleTable.Maintenance_Contract__r.RecordType.DeveloperName == 'NewMaintenance_Contract' |
| | | && middleTable.Maintenance_Contract__r.Limit_Price__c == true) { |
| | | //新建修理即无修理报价 维修合同上的修理剩余金额如果小于等于0 那么【超过合同上限】为true |
| | | if (middleTable.Maintenance_Contract__r.Remaining_Amount__c <= 0 ) { |
| | | repair.ZFLAG_CGSX__c = true; |
| | | } |
| | | } |
| | | //上限合同 LY 20230117 end |
| | | needsetnull = false; |
| | | System.debug( '-----:自动带出维修合同22222');//把保有设备上的维修合同存到修理上 |
| | | break; |
| | |
| | | // これより、备品借出申请の「修理最终检测日」を更新するロジック(更新后触发WorkFlow) |
| | | // ---------------------------------------------------------------------- |
| | | if (Trigger.isAfter && Trigger.isUpdate) { |
| | | |
| | | System.debug( '-----: sendEmailByInspectionFailureCause start'); |
| | | //【委托】【QA部门】IISE多次同步课题 WLIG-CJJDAV start |
| | | RepairTrigger.sendEmailByInspectionFailureCause(Trigger.new, Trigger.newMap, Trigger.old, Trigger.oldMap); |
| | | //【委托】【QA部门】IISE多次同步课题 WLIG-CJJDAV end |
| | | |
| | | Map<String, Date> repairDateMap = new Map<String, Date>(); |
| | | List<String> targetRepairList = new List<String>(); |
| | | for (Repair__c repair : Trigger.New) { |
| | |
| | | // ---------------------------------------------------------------------- |
| | | // ここまで、备品借出申请の「修理最终检测日」を更新するロジック |
| | | // ---------------------------------------------------------------------- |
| | | |
| | | |
| | | // 2022-12-22 zyh add Start |
| | | if (Trigger.isAfter && Trigger.isUpdate) { |
| | | List < String > rprIds = new List < String > (); |
| | | Map < Id, Id > rprIdMap = new Map < Id, Id > (); |
| | | for (Repair__c rpr: Trigger.new) { |
| | | Repair__c oldrpr = Trigger.oldMap.get(rpr.Id); |
| | | // 修理有报修子单号,并且 待发送AWS为false 发送给AWS |
| | | if (String.isNotBlank(rpr.RepairSubOrder__c) && !rpr.AwaitToSendAWS__c) { |
| | | if ((rpr.DescriptionName__c != oldrpr.DescriptionName__c) |
| | | || (rpr.InspectionResultFlag__c != oldrpr.InspectionResultFlag__c) |
| | | || (rpr.RepairReasonTrigger__c != oldrpr.RepairReasonTrigger__c)) { |
| | | if (NFM603Controller.NFM603_Ids.contains(rpr.Id) == false) { |
| | | NFM603Controller.NFM603_Ids.add(rpr.Id); |
| | | rprIdMap.put(rpr.Id, rpr.Id); |
| | | System.debug('111111111111111111112222222222'); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | rprIds = rprIdMap.values(); |
| | | |
| | | if (rprIds.size() > 0) { |
| | | BatchIF_Log__c iflog = new BatchIF_Log__c(); |
| | | iflog.Type__c = 'NFM603'; |
| | | iflog.Log__c = 'callout start\n'; |
| | | insert iflog; |
| | | // 2022-04-29 zyh update start |
| | | if(UserInfo.getUserId().equals(System.Label.interfaceUserID)){ |
| | | NFM603Controller.executefuture(iflog, rprIds); |
| | | }else{ |
| | | NFM603Controller.callout(iflog.Id, rprIds); |
| | | } |
| | | // 2022-04-29 zyh update end |
| | | } |
| | | } |
| | | // 2022-12-22 zyh add END |
| | | |
| | | //上限合同 LY 20230207 start |
| | | //维修合同上的修理剩余金额如果大于0,且【剩余金额】减去修理报价的计入【合同消费率的修理金额】小于等于0,那么【到达上限】为true |
| | | if (Trigger.isBefore && Trigger.isUpdate) { |
| | | for (Repair__c repair: Trigger.new) { |
| | | if (repair.Limit_Price__c ==true ){ |
| | | if (repair.Agreed_Date__c!=null && repair.Remaining_Amount__c >=0 &&(repair.Remaining_Amount__c-repair.Usage_Ratio_Price__c)<=0){ |
| | | repair.ZFLAG_SX__c = true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //上限合同 LY 20230207 end |
| | | System.debug( '-----: trigger end'); |
| | | } |
| | | public void test(){ |