Commit 0f7a45ff zshaohui

1.单据转库,锁定库位

2.任务按料号排序出库
3.条码管理 创建时间 取 修改时间
1 个父辈 57d92a64
......@@ -80,6 +80,7 @@ public class BarcodeController {
//如果栈板ID不为空,优先使用扫描的栈板ID
if (StringUtils.isNotEmpty(dto.getScanCartonId())){
dto.setPalletId(dto.getScanCartonId());
dto.setCreateDate(dto.getUpdateDate());
}
newBarcodeDtos.add(dto);
}
......
......@@ -3,9 +3,11 @@ package com.neotel.smfcore.core.order;
import cn.hutool.core.util.ObjectUtil;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.neotel.smfcore.common.bean.ReelLockPosInfo;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.ReelLockPosUtil;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.api.SmfApi;
......@@ -1766,6 +1768,7 @@ public class LiteOrderCache {
newPosIdList.add(newPos.getId());
task.setLoc(newPos.getPosName());
task.updateExtraDataMap("targetPos", newPos.getPosName());
task.updateExtraDataMap("targetPosId", newPos.getId());
task.setOperator(SecurityUtils.getLoginUsername()+"单据转库");
dataLogList.add(task);
}
......@@ -1777,6 +1780,29 @@ public class LiteOrderCache {
throw new ValidateException("smfcore.order.out.noTask", "工单无可执行的任务");
}
List<String> cidList = new ArrayList<>();
for (Storage storage : dataCache.getAllStorage().values()) {
storageList.add(storage);
cidList.add(storage.getCid());
}
for (DataLog dataLog : dataLogList) {
Object targetPos = dataLog.getExtraDataMap("targetPos");
Object targetPosId = dataLog.getExtraDataMap("targetPosId");
if (targetPos != null && targetPosId != null) {
try {
log.info("单据转库,料箱号为:"+dataLog.getBarcode()+"锁定的新库位为:"+targetPos.toString());
ReelLockPosInfo reelLocInfo = new ReelLockPosInfo();
reelLocInfo.setBarcode(dataLog.getBarcode());
reelLocInfo.setCid(dataLog.getCid());
reelLocInfo.setLockPosName(targetPos.toString());
reelLocInfo.setLockPosId(targetPosId.toString());
reelLocInfo = ReelLockPosUtil.addReelLockPosInfo(reelLocInfo, cidList);
} catch (Exception e) {
e.printStackTrace();
}
}
}
taskService.batchSave(dataLogList);
cacheOrder.setStatus(LITEORDER_STATUS.TAILS);
cacheOrder.setTaskReelCount(dataLogList.size());
......
......@@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@ApiOperation("AGV设备端")
......@@ -65,7 +66,10 @@ public class AgvDeviceController {
@AnonymousAccess
public List<DataLog> getCheckOutTask() {
List<DataLog> dataLogList = new ArrayList<>();
for (DataLog dataLog : taskService.getAllTasks()) {
List<DataLog> allTasks = taskService.getAllTasks();
if (allTasks != null && !allTasks.isEmpty()){
allTasks = allTasks.stream().sorted(Comparator.comparing(DataLog :: getPartNumber)).collect(Collectors.toList());
for (DataLog dataLog : allTasks) {
if (dataLogList != null && dataLogList.size() > 6){
break;
}
......@@ -78,6 +82,7 @@ public class AgvDeviceController {
}
}
}
}
return dataLogList;
}
......
......@@ -247,6 +247,8 @@ public class BoxTransferController {
storagePosManager.save(storagePos);
queueTask.setStatus(OP_STATUS.FINISHED.name());
ReelLockPosUtil.removeReelLockPosInfo(barcode.getBarcode());
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!