Browse Source

feat: 添加静置时间判断日志

master
李永德 11 months ago
parent
commit
c6de04c178
  1. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  2. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/enums/TagNameEnum.java
  3. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java

4
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.setMove_way(one.getMove_way() + " -> " + basePoint.getPoint_code());
} }
one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue()); one.setGroup_bind_material_status(GroupBindMaterialStatusEnum.UNBOUND.getValue());
TaskUtils.setGroupUpdateByAcs(one);
vehiclematerialgroupService.updateById(one);
// 记录泥料 // 记录泥料
MesMudConsumptionDto mesMudConsumptionDto = new MesMudConsumptionDto(); MesMudConsumptionDto mesMudConsumptionDto = new MesMudConsumptionDto();
mesMudConsumptionDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr()); mesMudConsumptionDto.setMSGID(IdUtil.getSnowflake(1, 1).nextIdStr());
@ -726,8 +728,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
taskResponse.setMessage(CommonUtils.remainStandingFinishTime(one.getInstorage_time(), taskResponse.setMessage(CommonUtils.remainStandingFinishTime(one.getInstorage_time(),
one.getStanding_time())); one.getStanding_time()));
} }
TaskUtils.setGroupUpdateByAcs(one);
vehiclematerialgroupService.updateById(one);
return taskResponse; return taskResponse;
} }

4
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("物料同步"), MATERIAL_SYNCHRONIZATION("物料同步"),
/**
* 静置校验
*/
STANDING_CHECK("静置校验"),
/** /**
* 标记符号 * 标记符号
*/ */

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/CommonUtils.java

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

Loading…
Cancel
Save