From c6de04c1780e4d86a5a775b925dd0b11067d049c Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Sat, 6 Jan 2024 11:55:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=9D=99=E7=BD=AE?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=88=A4=E6=96=AD=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java | 4 ++-- .../java/org/nl/wms/sch/task_manage/enums/TagNameEnum.java | 4 ++++ .../src/main/java/org/nl/wms/util/CommonUtils.java | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index 036e556..2694191 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -689,6 +689,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { one.setMove_way(one.getMove_way() + " -> " + basePoint.getPoint_code()); } one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); + TaskUtils.setGroupUpdateByAcs(one); + vehiclematerialgroupService.updateById(one); // 记录泥料 MesMudConsumptionDto mesMudConsumptionDto = new MesMudConsumptionDto(); mesMudConsumptionDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); @@ -726,8 +728,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { taskResponse.setMessage(CommonUtils.remainStandingFinishTime(one.getInstorage_time(), one.getStanding_time())); } - TaskUtils.setGroupUpdateByAcs(one); - vehiclematerialgroupService.updateById(one); return taskResponse; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/enums/TagNameEnum.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/enums/TagNameEnum.java index b151ffd..b9ed32b 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/enums/TagNameEnum.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/enums/TagNameEnum.java @@ -19,6 +19,10 @@ public enum TagNameEnum { * 物料同步 */ MATERIAL_SYNCHRONIZATION("物料同步"), + /** + * 静置校验 + */ + STANDING_CHECK("静置校验"), /** * 标记符号 */ diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java index b205487..2a6ce6f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java @@ -1,8 +1,11 @@ package org.nl.wms.util; import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; import org.nl.wms.ext.acs.service.dto.SignalData; import org.nl.wms.ext.acs.service.dto.to.acs.PutActionRequest; +import org.nl.wms.sch.task_manage.enums.TagNameEnum; +import org.slf4j.MDC; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -17,6 +20,7 @@ import java.util.*; * @Description: 通用工具 * @Date: 2023/7/17 */ +@Slf4j public class CommonUtils { /** * @param inStorageTime 入库时间 @@ -24,11 +28,14 @@ public class CommonUtils { * @return */ public static boolean isStandingFinish(String inStorageTime, Integer standingTime) { + MDC.put("tag_name", TagNameEnum.STANDING_CHECK.getTag()); + log.info("判断静置时间->入库时间{},静置时间{}", inStorageTime, standingTime); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); LocalDateTime inStorageDateTime = LocalDateTime.parse(inStorageTime, formatter); Duration standingDuration = Duration.ofMinutes(standingTime); LocalDateTime currentTime = LocalDateTime.now(); LocalDateTime expiryTime = inStorageDateTime.plus(standingDuration); + log.info("时间转换:当前时间{}-期望时间{}", currentTime, expiryTime); return currentTime.isAfter(expiryTime); }