Commit 3c5cf246 zshaohui

1.根据cid,生成所有料箱的出库任务

1 个父辈 48f673de
...@@ -822,6 +822,9 @@ public class TaskService { ...@@ -822,6 +822,9 @@ public class TaskService {
for (DataLog task : allTasksa) { for (DataLog task : allTasksa) {
if (task.isPutInTask()) { if (task.isPutInTask()) {
if (task.isFinished() || task.isCancel()){
continue;
}
if (task.getBarcode().equals(barcode.getBarcode())) { if (task.getBarcode().equals(barcode.getBarcode())) {
//同一个条码的入库任务 //同一个条码的入库任务
for (Storage storage : storageList) { for (Storage storage : storageList) {
......
...@@ -393,6 +393,46 @@ public class Device1588Controller { ...@@ -393,6 +393,46 @@ public class Device1588Controller {
return ResultBean.newOkResult(cacheMap); return ResultBean.newOkResult(cacheMap);
} }
/**
* 4.生成所有出库任务,根据cid
*/
@ApiOperation("生成所有出库任务,根据cid")
@RequestMapping("/generateAllTaskByCid")
@AnonymousAccess
public ResultBean generateAllTaskByCid(String cid) {
Storage storage = dataCache.getStorage(cid);
List<StoragePos> storagePosList = storagePosManager.findNotEmptyByStorageId(storage.getId());
if (storagePosList != null && !storagePosList.isEmpty()) {
for (StoragePos pos : storagePosList) {
boolean hasNoFinishedTask = hasNoFinishedTask(pos.getId());
if (hasNoFinishedTask) {
continue;
}
//判断有没有禁用
if (!pos.isEnabled()) {
continue;
}
Barcode barcode = pos.getBarcode();
if (barcode == null) {
continue;
}
//判断有没有被锁定
String reelLockPosId = ReelLockPosUtil.getReelLockPosId(barcode.getBarcode());
if (StringUtils.isNotEmpty(reelLockPosId)) {
continue;
}
DataLog dataLog = new DataLog(storage, pos.getBarcode(), pos);
dataLog.setLocInfo(TaskLoc.BOX_TASK_OUT);
dataLog.setType(OP.CHECKOUT);
taskService.addTaskToExecute(dataLog);
}
}
return ResultBean.newOkResult("");
}
private void putInNewBox(Barcode barcode, Barcode boxBarcode) { private void putInNewBox(Barcode barcode, Barcode boxBarcode) {
StoragePos pos = storagePosManager.getByBarcode(boxBarcode.getBarcode()); StoragePos pos = storagePosManager.getByBarcode(boxBarcode.getBarcode());
if (pos != null) { if (pos != null) {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!