From 4488f711dbc01a8db6753907cae2ef4021dede68 Mon Sep 17 00:00:00 2001
From: FUYU <fuyu@prec-tech.com>
Date: 星期三, 13 十二月 2023 16:30:27 +0800
Subject: [PATCH] 修改前备份

---
 force-app/main/default/triggers/UserToContact.trigger |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/force-app/main/default/triggers/UserToContact.trigger b/force-app/main/default/triggers/UserToContact.trigger
index 9794226..5dea882 100644
--- a/force-app/main/default/triggers/UserToContact.trigger
+++ b/force-app/main/default/triggers/UserToContact.trigger
@@ -12,6 +12,18 @@
         if (Trigger.isUpdate) {
             old = Trigger.oldMap.get(local.Id);
         }
+
+        //20230303 lt DB202302421915 start 
+        if(Trigger.isBefore && Trigger.isUpdate && local.Pregnant_Rest__c != old.Pregnant_Rest__c){
+            if(old.Pregnant_Rest__c == FALSE && local.Pregnant_Rest__c == TRUE){
+                local.Maternity_leave_StartDate__c = Date.today();
+            }
+            if(old.Pregnant_Rest__c == TRUE && local.Pregnant_Rest__c == FALSE){
+                local.Maternity_leave_EndDate__c = Date.today();
+            }
+        }
+        //20230303 lt DB202302421915 end
+
         if (String.isNotBlank(local.Employee_No__c)  
                             && ( Trigger.isInsert 
                             || old.Test_staff__c != local.Test_staff__c
@@ -56,7 +68,7 @@
             } 
 
         }
-        system.debug('UserToContact'+old.HR_Post__c+'==='+local.HR_Post__c);
+        // system.debug('UserToContact'+old.HR_Post__c+'==='+local.HR_Post__c);
         if (String.isNotBlank(local.Employee_No__c) && (Trigger.isInsert 
                             || old.Mobile_Phone__c != local.Mobile_Phone__c  //鎵嬫満鍙风爜2 MobilePhone
                             || old.Work_Location__c != local.Work_Location__c  //宸ヤ綔鍦� Work_Location_manual__c
@@ -66,6 +78,7 @@
                             //|| old.Post__c != local.Post__c  //鑱屼綅 Post_picklist__c
                             || old.HR_Post__c != local.HR_Post__c//HR閫氱敤鑱岀骇 //20220425  LLIU-CCY9TA you
                             || old.PositionSubsequence__c != local.PositionSubsequence__c//20220428 LLIU-CDW5ZW you 宀椾綅瀛愬簭鍒�
+                            || old.Rank__c != local.Rank__c//20220512 you LLIU-CDW5ZW start 鑱岀骇
                             || old.Gender__c != local.Gender__c  //鎬у埆 Gender_text__c
                             || old.Pregnant_Rest__c != local.Pregnant_Rest__c // 鏄惁浜у亣 Pregnant_Rest__c
                             || old.Dept__c != local.Dept__c  //鏈儴 dept__c
@@ -117,6 +130,7 @@
                     //|| oldu.Post__c != newu.Post__c//鑱屼綅
                     || oldu.HR_Post__c != newu.HR_Post__c//HR閫氱敤鑱岀骇 //20220425  LLIU-CCY9TA you
                     || oldu.PositionSubsequence__c != newu.PositionSubsequence__c//20220428 LLIU-CDW5ZW you 宀椾綅瀛愬簭鍒�
+                    || oldu.Rank__c != newu.Rank__c//20220512 you LLIU-CDW5ZW start 鑱岀骇
                     || oldu.Job_Category__c != newu.Job_Category__c//鑱岀
                     //鐢ㄦ埛鐨勫伐浣滃湴锛堜汉浜嬶級鏀瑰彉,鏇存柊HR淇℃伅涓婄殑鐢ㄦ埛瀛楁 thh 2022-02-17 start
                     || oldu.Work_Location_HR__c != newu.Work_Location_HR__c 

--
Gitblit v1.9.1