liupeng 4 years ago
parent
commit
a9f9c8a501

+ 9 - 0
code/sapparent/sapservice/src/main/java/org/fouram/mapper/SapCheckMapper.xml

@@ -108,6 +108,15 @@
 		where a.checkinDay = b.`day` and a.userId = b.userId;
 	</update>
 	
+	<update id="updateResultOkByAllLeave">
+		update sap_check_report a ,sap_employee_time f 
+		SET a.result = '正常',a.leaveCreatedTime = f.createdDateTime, 
+			a.leaveStartDate = f.startDate, a.leaveEndDate = f.endDate,
+			a.leaveDay = f.deductionQuantity, a.leaveComment =f.`comment`
+		where a.userId = f.userId and a.checkinDay >= f.startDate and a.checkinDay &lt;= f.endDate 
+			and f.approvalStatus = 'APPROVED' and f.delFlag=0 and a.result = '异常'
+	</update>
+	
 	<select id="selectLeaveDayList" resultType="SapCheckReport">
 		SELECT * from sap_check_report where result = '异常' and leaveDay is not null 
 			and checkinDay >= #{startDay} and checkinDay &lt;= #{endDay}

+ 3 - 0
code/sapparent/sapservice/src/main/java/org/fouram/service/SapCheckService.java

@@ -179,6 +179,9 @@ public class SapCheckService extends BaseService {
 		
 		// 更新所有有补卡日期的记录为正常
 		update("SapCheckMapper.updateResultOkByAllBuKa", null);
+		
+		// 请假状态会后期调整,需要针对请假通过更新为正常
+		update("SapCheckMapper.updateResultOkByAllLeave", null);
 	}
 
 	// 是不是正确的上班时间