trigger OPDPlanUp on OPDPlan__c (before Insert,after Insert,after update,before update) {
|
|
//deloitte-zhj 20231124 本地化导入 start
|
if((!Test.isRunningTest())&&System.Label.ByPassTrigger.contains(UserInfo.getUserId())){
|
return;
|
}
|
//deloitte-zhj 20231124 本地化导入 end
|
//和正式不一致临时注释 20231125 sx start
|
// if(StaticParameter.OPDPlanUp == true){
|
// System.debug( '-----:リードのトリガー動きません');
|
// return;
|
// }
|
//和正式不一致临时注释 20231125 sx end
|
System.debug('----------后续Trigger执行');
|
OPDPlanHandler handler = new OPDPlanHandler();
|
handler.run();
|
// 备品智能化 2023-12-29 add by dzk start 学会,询价新建OPD计划,自动转计划出借备品数据
|
// 询价的报价的报价项关联的产品符合备品借出条件的场合,
|
if (Trigger.isInsert && Trigger.isAfter) {
|
System.debug('OPD----------Insert');
|
for(OPDPlan__c opd : Trigger.new){
|
if(opd.OPDType__c != '事件' && String.isBlank(opd.OriginalOpdPlan__c) && String.isBlank(opd.OriginalOpdPlanRental__c)){ //20240204 sx 分单OPD不需要走新建逻辑
|
OpdPlan_CreatePlanRentalEquipmentHandler.createPlanRentalEquipment(Trigger.new);
|
}
|
}
|
}
|
if (Trigger.isUpdate && Trigger.isAfter) {
|
System.debug('OPD----------Update');
|
for(OPDPlan__c opd : Trigger.new){
|
if(opd.Status__c == '提交' && trigger.oldMap.get(opd.Id).Status__c != '提交' ){
|
OpdPlan_CreatePlanRentalEquipmentHandler.updateOPDPlan(Trigger.new);
|
}
|
}
|
}
|
// 备品智能化 2023-12-29 add by dzk end
|
}
|