From ebb8c5b2f532f197932dca595030154ab803e371 Mon Sep 17 00:00:00 2001 From: zhouz <> Date: Wed, 5 Nov 2025 13:54:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=87=BA=E7=A9=BA=E6=9C=A8=E7=AE=B1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mes/service/impl/LmsToMesServiceImpl.java | 25 ++++++++++++----- .../sch/manage/AutoSendInStorFeiShuInfo.java | 27 +++++++++++++++++++ .../nl/wms/stat/wql/ST_IVT_INBILLQUERY.wql | 2 +- 3 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AutoSendInStorFeiShuInfo.java diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/LmsToMesServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/LmsToMesServiceImpl.java index 00b71a3d9..2e0ab1218 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/LmsToMesServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/LmsToMesServiceImpl.java @@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Service; +import javax.swing.*; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; @@ -1238,11 +1239,22 @@ public class LmsToMesServiceImpl implements LmsToMesService { // 获取当前时间 LocalDateTime now = LocalDateTime.now(); - // 1. 当天早上 8 点:将当前时间的时、分、秒、纳秒设为 8:00:00 - LocalDateTime today8AM = now.withHour(7) - .withMinute(59) - .withSecond(59) - .withNano(0); + String feishu_time = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("FEISHU_TIME").getValue(); + LocalDateTime today8AM; + if (StrUtil.isEmpty(feishu_time)) { + // 1. 当天早上 8 点:将当前时间的时、分、秒、纳秒设为 8:00:00 + today8AM = now.withHour(7) + .withMinute(59) + .withSecond(59) + .withNano(0); + } else { + String dateTimeStr = feishu_time + "T00:00:00"; + LocalDateTime dateTime = LocalDateTime.parse(dateTimeStr); + today8AM =dateTime.withHour(7) + .withMinute(59) + .withSecond(59) + .withNano(0); + } // 2. 前一天早上 8 点:当天 8 点减去 1 天 LocalDateTime yesterday8AM = today8AM.minus(1, ChronoUnit.DAYS).plusSeconds(1); @@ -1298,7 +1310,7 @@ public class LmsToMesServiceImpl implements LmsToMesService { try { String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("FEISHU_INSTOR").getValue(); String api = "FeiShuNoticesWebApi/EditSheetApi"; - String resultMsg = HttpRequest.post(url+api) + String resultMsg = HttpRequest.post(url + api) .body(String.valueOf(feishu_json)) .execute().body(); log.info("飞书输入参数为:-------------------" + feishu_json); @@ -1307,4 +1319,5 @@ public class LmsToMesServiceImpl implements LmsToMesService { log.info(e.getMessage()); } } + } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AutoSendInStorFeiShuInfo.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AutoSendInStorFeiShuInfo.java new file mode 100644 index 000000000..f685c7a10 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AutoSendInStorFeiShuInfo.java @@ -0,0 +1,27 @@ +package org.nl.wms.sch.manage; + +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.nl.wms.ext.mes.service.LmsToMesService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Slf4j +@Component +@RequiredArgsConstructor +public class AutoSendInStorFeiShuInfo { + + @Autowired + private LmsToMesService lmsToMesService; + + @SneakyThrows + public void run() { + this.sendInfo(); + } + + void sendInfo() { + lmsToMesService.EditSheetApi(new JSONObject()); + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/stat/wql/ST_IVT_INBILLQUERY.wql b/lms/nladmin-system/src/main/java/org/nl/wms/stat/wql/ST_IVT_INBILLQUERY.wql index 982e0f2fa..a2ef039da 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/stat/wql/ST_IVT_INBILLQUERY.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/stat/wql/ST_IVT_INBILLQUERY.wql @@ -1298,7 +1298,7 @@ IF 输入.flag = "7" QUERY SELECT - FLOOR(UNIX_TIMESTAMP(DATE_FORMAT(NOW(), '%Y-%m-%d 08:00:00')) * 1000) AS '日期', + FLOOR(UNIX_TIMESTAMP(DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 DAY), '%Y-%m-%d 08:00:00')) * 1000) AS '日期', CASE WHEN DATE_FORMAT(mst.confirm_time, '%H:%i:%s') >= '08:00:00' AND DATE_FORMAT(mst.confirm_time, '%H:%i:%s') <= '19:59:59' THEN '白班'