fix:出空木箱修改

This commit is contained in:
zhouz
2025-11-05 13:54:52 +08:00
parent 1ea8dab5b3
commit ebb8c5b2f5
3 changed files with 47 additions and 7 deletions

View File

@@ -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());
}
}
}

View File

@@ -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());
}
}

View File

@@ -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 '白班'