no message

main
HUOJIN\92525 2026-02-04 20:25:49 +08:00
parent 118ac65dcb
commit 353ca68ab5
1 changed files with 30 additions and 3 deletions

View File

@ -214,10 +214,37 @@ public class ITesAgvServiceImpl implements ITesAgvService {
@Override
@Transactional(rollbackFor = Exception.class)
public void containerUp(ContainerUpRequest containerUpRequest) {
String id = containerUpRequest.getContent().getBizID();
ContainerUpRequest.Content content = containerUpRequest.getContent();
String id = content.getBizID();
AgvTask agvTask = agvTaskMapper.selectById(Long.parseLong(id));
agvTask.setOutBinTime(new Date());
agvTaskMapper.updateById(agvTask);
if (agvTask == null) {
throw new RuntimeException("【" + id + "】任务不存在");
}
if(agvTask.getOutBinTime()!=null){
return;
}
String businessType = agvTask.getType();
String startCode = agvTask.getStartCode();
boolean needUpdateOutBinTime = false; // 标记是否需要更新时间
if (BusinessTypeEnum.INBOUND.getValue().equals(businessType)) {
String stationCode = content.getStationCode();
if (stationCode.equals(startCode)) {
agvTask.setOutBinTime(new Date());
needUpdateOutBinTime = true;
}
} else if (BusinessTypeEnum.OUTBOUND.getValue().equals(businessType)
|| BusinessTypeEnum.MOVE.getValue().equals(businessType)) {
String nodeCode = content.getNodeCode();
if (nodeCode.equals(startCode)) {
agvTask.setOutBinTime(new Date());
needUpdateOutBinTime = true;
}
}
if (needUpdateOutBinTime) {
agvTaskMapper.updateById(agvTask);
}
}