Ver código fonte

日志改动

xujunjie 2 anos atrás
pai
commit
ba946e2487

+ 5 - 2
src/pages/ReportDaily/Index.js

@@ -30,8 +30,11 @@ const ReportSummary = () => {
       .startOf('day');
     const endDate = selectedDate
       .clone()
-      .date(25)
-      .endOf('day');
+      .date(26) // 26号的9点为止
+      .hour(9)
+      .minute(0)
+      .second(0)
+      .millisecond(0);
 
     setLoading(true);
     try {

+ 6 - 2
src/pages/ReportDaily/utils.js

@@ -64,7 +64,11 @@ async function analyzeDates(dateArray, startDate, endDate, holiday, takingLeave)
   const sortedDates = dateArray.sort((a, b) => a - b);
   const currentDay = startDate.clone();
 
-  while (currentDay.isSameOrBefore(endDate, 'day')) {
+  // 日志查询至26号9点,实际截至时间为25号24点
+  // 所以结束时间为endDate - 1天
+  let end = moment(endDate).subtract(1, 'days')
+
+  while (currentDay.isSameOrBefore(end, 'day')) {
     let index = -1;
     let dayKey = currentDay.format('YYYY-MM-DD');
     if (holiday[dayKey] || currentDay.day() === 0 || currentDay.day() === 6) {
@@ -157,7 +161,7 @@ export async function getData(startTime, endTime, onProcess) {
     reportData,
     onProcess,
   });
-
+  debugger
   // 判断员工入职时间和离职时间
   await filterByHireDate(employeeData, onProcess);
   await filterByResignationDate(employeeData, onProcess);

+ 4 - 2
src/services/ReportDaily.js

@@ -3,7 +3,7 @@ const moment = require('moment');
 
 let api = axios.create({
   // baseURL: 'http://47.96.12.136:8123/api',
-  baseURL: 'http://192.168.20.168:8123/api',
+  baseURL: 'http://192.168.20.241:8123/api',
 });
 
 async function getToken() {
@@ -212,7 +212,9 @@ export async function getAllReport(startDate, endDate, onProcess) {
 // 查询节假日
 export async function getHoliday(onProcess) {
   let res,
-    days = {};
+    days = {
+      "2023-07-07": 1
+    };
   res = await axios.get(
     'https://www.mxnzp.com/api/holiday/list/year/2023?ignoreHoliday=false&app_id=kf6mqlkirgupfcok&app_secret=MDRIVy83WTN4Q0lEaUZVMEFGejFWdz09'
   );