|
@ -1,8 +1,11 @@ |
|
|
package org.nl.wms.util; |
|
|
package org.nl.wms.util; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
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.SignalData; |
|
|
import org.nl.wms.ext.acs.service.dto.to.acs.PutActionRequest; |
|
|
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.ParseException; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
@ -17,6 +20,7 @@ import java.util.*; |
|
|
* @Description: 通用工具 |
|
|
* @Description: 通用工具 |
|
|
* @Date: 2023/7/17 |
|
|
* @Date: 2023/7/17 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@Slf4j |
|
|
public class CommonUtils { |
|
|
public class CommonUtils { |
|
|
/** |
|
|
/** |
|
|
* @param inStorageTime 入库时间 |
|
|
* @param inStorageTime 入库时间 |
|
@ -24,11 +28,14 @@ public class CommonUtils { |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
public static boolean isStandingFinish(String inStorageTime, Integer standingTime) { |
|
|
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"); |
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
|
|
LocalDateTime inStorageDateTime = LocalDateTime.parse(inStorageTime, formatter); |
|
|
LocalDateTime inStorageDateTime = LocalDateTime.parse(inStorageTime, formatter); |
|
|
Duration standingDuration = Duration.ofMinutes(standingTime); |
|
|
Duration standingDuration = Duration.ofMinutes(standingTime); |
|
|
LocalDateTime currentTime = LocalDateTime.now(); |
|
|
LocalDateTime currentTime = LocalDateTime.now(); |
|
|
LocalDateTime expiryTime = inStorageDateTime.plus(standingDuration); |
|
|
LocalDateTime expiryTime = inStorageDateTime.plus(standingDuration); |
|
|
|
|
|
log.info("时间转换:当前时间{}-期望时间{}", currentTime, expiryTime); |
|
|
return currentTime.isAfter(expiryTime); |
|
|
return currentTime.isAfter(expiryTime); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|