| | |
| | | } |
| | | protected override void beforeInsert() { |
| | | mobileNumberVerification(); |
| | | sendToComPlat(); |
| | | } |
| | | |
| | | protected override void afterInsert() { |
| | | syncToAgencyContact(); |
| | | updateDealerNum(); |
| | | sendToComPlat(); |
| | | } |
| | | |
| | | protected override void afterUpdate() { |
| | | syncToAgencyContact(); |
| | | updateDealerNum(); |
| | | sendToComPlat(); |
| | | } |
| | | |
| | | protected override void beforeUpdate() { |
| | |
| | | UpdateProcessingWork(); |
| | | // 服务技师 2018/12/24 end |
| | | mobileNumberVerification(); |
| | | sendToComPlat(); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | //手机号唯一校验-医院下新建客户人员校验使用加密手机号,经销商使用普通手机号 thh 20220328 start |
| | | ID recordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | | ID DoctorRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Doctor').getRecordTypeId(); |
| | | ID AgencyRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | | for (Contact contactnew : newList) { |
| | | // 手机号有值并且联系人有效,联系人的客户有效,进行手机号码验证 |
| | | if (('有效'.equals(contactnew.Isactive__c) || '有効'.equals(contactnew.Isactive__c)) |
| | | && ('有効'.equals(accMap.get(contactnew.AccountId)) || '有效'.equals(accMap.get(contactnew.AccountId)))) { |
| | | if(contactnew.RecordTypeId.equals(recordTypeId)){ |
| | | if(AgencyRecordTypeId.equals(contactnew.RecordTypeId)){ |
| | | if(String.isNotBlank(contactnew.MobilePhone)){ |
| | | Matcher isMobilePhone = pattern.matcher(contactnew.MobilePhone); |
| | | if (isMobilePhone.matches()) { |
| | |
| | | } else { |
| | | contactnew.UniqueNumber__c = null; |
| | | } |
| | | } else{ |
| | | } else if(DoctorRecordTypeId.equals(contactnew.RecordTypeId)){ |
| | | if(String.isNotBlank(contactnew.MobilePhone_Encrypted__c)){ |
| | | contactnew.UniqueNumber__c = contactnew.MobilePhone_Encrypted__c; |
| | | } else { |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public static Map<Id,Id> NFM606_IdMap = new Map<Id,Id>(); |
| | | // 606接口调用问题修复 thh 20220330 start |
| | | private void sendToComPlat() { |
| | | List<Id> contactIdList = new List<Id>(); |
| | | List<String> interfaceUserUpsertContact = new List<String>(); |
| | |
| | | || old.ContactType__c != local.ContactType__c//人员类型 |
| | | |
| | | ) { |
| | | //624调用606问题修复 thh 20220328 start |
| | | if (!local.IsFromSPO__c && !'01210000000QtkyAAC'.equals(local.RecordTypeId)) { |
| | | //获取客户人员的记录类型ID thh 20220330 start |
| | | ID InternalStaffRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Internal_staff').getRecordTypeId(); |
| | | ID DoctorRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Doctor').getRecordTypeId(); |
| | | ID AgencyRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByDeveloperName().get('Agency').getRecordTypeId(); |
| | | //获取客户人员的记录类型ID thh 20220330 end |
| | | if (!local.IsFromSPO__c && !InternalStaffRecordTypeId.equals(local.RecordTypeId)) { |
| | | |
| | | // 医院 客户人员 统一平台编码有值 发送 PO |
| | | if ('01210000000QfWdAAK'.equals(local.RecordTypeId) && String.isNotBlank(local.UnifiedI_Contact_ID__c)) { |
| | | if (DoctorRecordTypeId.equals(local.RecordTypeId) && String.isNotBlank(local.UnifiedI_Contact_ID__c)) { |
| | | if (!NFM606_IdMap.containsKey(local.Id)) { |
| | | // if(UserInfo.getProfileId().equals(System.Label.ProfileId_SystemAdmin)){ |
| | | // interfaceUserUpsertContact.add(local.Id); |
| | | // } else { |
| | | // contactIdList.add(local.Id); |
| | | // } |
| | | local.trigger606Flag__c = true; |
| | | if(UserInfo.getUserId().equals(System.Label.interfaceUserID)){ |
| | | interfaceUserUpsertContact.add(local.Id); |
| | | } else { |
| | | contactIdList.add(local.Id); |
| | | } |
| | | NFM606_IdMap.put(local.Id, local.Id); |
| | | } |
| | | } |
| | | // 经销商 客户人员 手机号码有值 发送 PO |
| | | if ('01210000000QfWiAAK'.equals(local.RecordTypeId) && String.isNotBlank(local.MobilePhone)) { |
| | | if (AgencyRecordTypeId.equals(local.RecordTypeId) && String.isNotBlank(local.MobilePhone)) { |
| | | if (!NFM606_IdMap.containsKey(local.Id)) { |
| | | // if(UserInfo.getProfileId().equals(System.Label.ProfileId_SystemAdmin)){ |
| | | // interfaceUserUpsertContact.add(local.Id); |
| | | // } else { |
| | | // contactIdList.add(local.Id); |
| | | // } |
| | | local.trigger606Flag__c = true; |
| | | if(UserInfo.getUserId().equals(System.Label.interfaceUserID)){ |
| | | interfaceUserUpsertContact.add(local.Id); |
| | | } else { |
| | | contactIdList.add(local.Id); |
| | | } |
| | | NFM606_IdMap.put(local.Id, local.Id); |
| | | } |
| | | } |
| | | } |
| | | //624调用606问题修复 thh 20220328 end |
| | | |
| | | } |
| | | } |
| | | //606标记 |
| | | // if(!System.Test.isRunningTest()){ |
| | | // // NFM606Controller.executeNotFuture('', contactIdList); |
| | | // //624调用606问题修复 thh 20220325 start |
| | | // if (contactIdList.size() > 0) { |
| | | // // NFM606Controller.callout('', contactIdList); |
| | | // //添加future 判断 add for pipl sushanhu 20220317 start |
| | | // if (!(System.isFuture()||System.isBatch())) { |
| | | // NFM606Controller.callout('', contactIdList); |
| | | // } else{ |
| | | // NFM606Controller.executeNotFuture('', contactIdList); |
| | | // } |
| | | // //添加future 判断 add for pipl sushanhu 20220317 end |
| | | // } |
| | | // if (interfaceUserUpsertContact.size() > 0) { |
| | | // NFM606Controller.executeNotFuture('', interfaceUserUpsertContact); |
| | | if(!System.Test.isRunningTest()){ |
| | | // NFM606Controller.executeNotFuture('', contactIdList); |
| | | if (contactIdList.size() > 0) { |
| | | // NFM606Controller.callout('', contactIdList); |
| | | //添加future 判断 add for pipl sushanhu 20220317 start |
| | | // if (!(System.isFuture()||System.isBatch())) { |
| | | NFM606Controller.callout('', contactIdList); |
| | | // } else{ |
| | | // NFM606Controller.executeNotFuture('', contactIdList); |
| | | // } |
| | | //添加future 判断 add for pipl sushanhu 20220317 end |
| | | } |
| | | if (interfaceUserUpsertContact.size() > 0) { |
| | | NFM606Controller.executeNotFuture('', interfaceUserUpsertContact); |
| | | //添加future 判断 add for pipl sushanhu 20220316 start |
| | | // if (!(System.isFuture()||System.isBatch())) { |
| | | // NFM606Controller.executeNotFuture('', interfaceUserUpsertContact); |
| | | // NFM606Controller.executeNotFuture('', interfaceUserUpsertContact); |
| | | // } |
| | | //添加future 判断 add for pipl sushanhu 20220316 end |
| | | |
| | | // } |
| | | //624调用606问题修复 thh 20220325 end |
| | | // } |
| | | |
| | | } |
| | | } |
| | | } |
| | | // 606接口调用问题修复 thh 20220330 end |
| | | |
| | | } |