Commit 0f7a45ff zshaohui

1.单据转库,锁定库位

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