<?xml version="1.0" encoding="UTF-8"?>
<Workflow xmlns="http://soap.sforce.com/2006/04/metadata">
    <alerts>
        <fullName>ANIAllUser</fullName>
        <description>ANI全员通知邮件</description>
        <protected>false</protected>
        <recipients>
            <field>Director_email__c</field>
            <type>email</type>
        </recipients>
        <recipients>
            <recipient>NDTAllUser</recipient>
            <type>group</type>
        </recipients>
        <recipients>
            <type>owner</type>
        </recipients>
        <senderType>CurrentUser</senderType>
        <template>unfiled$public/ThawingPermissions_Mail</template>
    </alerts>
    <alerts>
        <fullName>NDTAllUser</fullName>
        <description>NDT全员邮件</description>
        <protected>false</protected>
        <recipients>
            <field>Director_email__c</field>
            <type>email</type>
        </recipients>
        <recipients>
            <recipient>NDTAllUser</recipient>
            <type>group</type>
        </recipients>
        <recipients>
            <type>owner</type>
        </recipients>
        <recipients>
            <recipient>prectech@ssbg.com</recipient>
            <type>user</type>
        </recipients>
        <senderType>CurrentUser</senderType>
        <template>unfiled$public/ThawingPermissions_Mail</template>
    </alerts>
    <alerts>
        <fullName>ThawingPermissions</fullName>
        <description>解冻借用权限</description>
        <protected>false</protected>
        <recipients>
            <field>Violations_User__c</field>
            <type>userLookup</type>
        </recipients>
        <senderType>CurrentUser</senderType>
        <template>unfiled$public/ThawingPermissions_Mail</template>
    </alerts>
    <alerts>
        <fullName>lockingEmail</fullName>
        <description>冻结邮件</description>
        <protected>false</protected>
        <recipients>
            <field>Director_email__c</field>
            <type>email</type>
        </recipients>
        <recipients>
            <type>owner</type>
        </recipients>
        <senderType>CurrentUser</senderType>
        <template>unfiled$public/NDT_Violation</template>
    </alerts>
    <alerts>
        <fullName>lockingEmailcc</fullName>
        <description>冻结邮件cc</description>
        <protected>false</protected>
        <recipients>
            <recipient>NDTAllUser</recipient>
            <type>group</type>
        </recipients>
        <senderType>CurrentUser</senderType>
        <template>unfiled$public/NDT_Violationcc</template>
    </alerts>
    <fieldUpdates>
        <fullName>finish_date</fullName>
        <field>Violations_Stop_Date__c</field>
        <formula>TODAY()</formula>
        <name>结束冻结</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Formula</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>finish_date1</fullName>
        <field>Violations_Stop_Date__c</field>
        <formula>TODAY()</formula>
        <name>结束冻结</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Formula</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>finish_date3</fullName>
        <field>Violations_Stop_Date__c</field>
        <formula>TODAY()</formula>
        <name>结束冻结</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Formula</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>finish_date4</fullName>
        <field>Violations_Stop_Date__c</field>
        <formula>TODAY()</formula>
        <name>结束冻结</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Formula</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>finish_date5</fullName>
        <field>Violations_Stop_Date__c</field>
        <formula>TODAY()</formula>
        <name>结束冻结</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Formula</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>finish_date6</fullName>
        <field>Violations_Stop_Date__c</field>
        <formula>TODAY()</formula>
        <name>结束冻结</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Formula</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>finish_date7</fullName>
        <field>Violations_Stop_Date__c</field>
        <formula>TODAY()</formula>
        <name>结束冻结</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Formula</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>finish_date8</fullName>
        <field>Violations_Stop_Date__c</field>
        <formula>TODAY()</formula>
        <name>结束冻结</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Formula</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>get_Director_email</fullName>
        <field>Director_email__c</field>
        <formula>Violations_Loaner__r.Director_email__c</formula>
        <name>获取责任人邮箱</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Formula</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>pass</fullName>
        <field>Is_locking__c</field>
        <literalValue>0</literalValue>
        <name>解冻批准</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>pass1</fullName>
        <field>Is_locking__c</field>
        <literalValue>0</literalValue>
        <name>解冻批准</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>pass2</fullName>
        <field>Is_locking__c</field>
        <literalValue>0</literalValue>
        <name>解冻批准</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>pass3</fullName>
        <field>Is_locking__c</field>
        <literalValue>0</literalValue>
        <name>解冻批准</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>pass4</fullName>
        <field>Is_locking__c</field>
        <literalValue>0</literalValue>
        <name>解冻批准</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>pass5</fullName>
        <field>Is_locking__c</field>
        <literalValue>0</literalValue>
        <name>解冻批准</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>pass6</fullName>
        <field>Is_locking__c</field>
        <literalValue>0</literalValue>
        <name>解冻批准</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>pass7</fullName>
        <field>Is_locking__c</field>
        <literalValue>0</literalValue>
        <name>解冻批准</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Literal</operation>
        <protected>false</protected>
    </fieldUpdates>
    <fieldUpdates>
        <fullName>user_type</fullName>
        <field>user_type_txt__c</field>
        <formula>user_type__c</formula>
        <name>用户分类记录</name>
        <notifyAssignee>false</notifyAssignee>
        <operation>Formula</operation>
        <protected>false</protected>
    </fieldUpdates>
    <rules>
        <fullName>NDT%2FANI违规邮件</fullName>
        <actions>
            <name>lockingEmail</name>
            <type>Alert</type>
        </actions>
        <actions>
            <name>lockingEmailcc</name>
            <type>Alert</type>
        </actions>
        <active>false</active>
        <formula>IF( AND(OR(user_type__c = &apos;NDT&apos;,
        user_type__c  = &apos;ANI&apos;), 
        Is_locking__c = true, 
        Is_effective__c = true ),
    IF( OR(Violations_User__r.ProfileId = &apos;00e28000000YMiL&apos;,
           Violations_User__r.ProfileId = &apos;00e28000000eN64&apos;, 
           Violations_User__r.ProfileId = &apos;00e0K000001l1E2&apos;,
           Violations_User__r.ProfileId = &apos;00e0K000001l1Dx&apos;,
           Violations_User__r.ProfileId = &apos;00e28000000YMif&apos;,
           Violations_User__r.ProfileId = &apos;00e28000000eN61&apos;,
           Violations_User__r.ProfileId = &apos;00e28000001wf2h&apos;,
           Violations_User__r.ProfileId = &apos;00e0K000001l1E7&apos;),
        false,
        true),
    false
)</formula>
        <triggerType>onCreateOrTriggeringUpdate</triggerType>
    </rules>
    <rules>
        <fullName>NDT%2FANI违规邮件_NEW</fullName>
        <actions>
            <name>lockingEmail</name>
            <type>Alert</type>
        </actions>
        <actions>
            <name>lockingEmailcc</name>
            <type>Alert</type>
        </actions>
        <active>true</active>
        <description>新的获取简档信息</description>
        <formula>IF( AND(OR(user_type__c = &apos;NDT&apos;,         user_type__c  = &apos;ANI&apos;),          Is_locking__c = true,          Is_effective__c = true ),     IF(CONTAINS($Label.NDT_ANI_violation_email,LEFT($User.Id,15)),         false,         true),     false )</formula>
        <triggerType>onCreateOrTriggeringUpdate</triggerType>
    </rules>
    <rules>
        <fullName>用户分类记录</fullName>
        <actions>
            <name>user_type</name>
            <type>FieldUpdate</type>
        </actions>
        <active>true</active>
        <criteriaItems>
            <field>User_Violations__c.user_type__c</field>
            <operation>notEqual</operation>
        </criteriaItems>
        <triggerType>onAllChanges</triggerType>
    </rules>
    <rules>
        <fullName>责任人邮箱</fullName>
        <actions>
            <name>get_Director_email</name>
            <type>FieldUpdate</type>
        </actions>
        <active>true</active>
        <criteriaItems>
            <field>loaner_application__c.Equipment_Type__c</field>
            <operation>equals</operation>
            <value>NDT,ANI</value>
        </criteriaItems>
        <triggerType>onCreateOnly</triggerType>
    </rules>
</Workflow>
