Commit cb57bfe9 LN

扫码入库bug修改

1 个父辈 a696ee3f
......@@ -96,7 +96,7 @@ public class DeviceController {
* 流水线入库查找空的料格
*/
@ApiOperation("环行线扫码获取库位号")
@PostMapping(value = "/emptyPosForPutin")
@PostMapping(value = "/service/store/emptyPosForPutin")
@ResponseBody
@AnonymousAccess
public Map<String,Object> emptyPosForPutin(HttpServletRequest request) {
......
......@@ -524,11 +524,11 @@ public class TaskService {
* @param barcode
* @return
*/
public StoragePos findEmptyPosForPutIn(List<Storage> storageList, Barcode barcode, String inRFID,String lastPosId) throws ValidateException{
verifyBarcodePutIn(storageList ,barcode, inRFID);
public StoragePos findEmptyPosForPutIn(List<Storage> storageList, Barcode barcode, String inRFID,String lastPosId) throws ValidateException {
verifyBarcodePutIn(storageList, barcode, inRFID);
//查找任务数最少的料仓
final Map<String,Integer> storageTaskCountMap = new HashMap<>();
final Map<String, Integer> storageTaskCountMap = new HashMap<>();
for (Storage storage : storageList) {
storageTaskCountMap.put(storage.getId(), 0);
}
......@@ -537,20 +537,20 @@ public class TaskService {
//如果有正在执行的任务,把库位发过去
Collection<DataLog> allTasks = taskMap.values();
for (DataLog task : allTasks) {
if(barcode.getBarcode().equals(task.getBarcode())){
if (barcode.getBarcode().equals(task.getBarcode())) {
String posId = task.getPosId();
log.info(barcode.getBarcode() + " 已有任务,返回任务中的库位:" + task.getPosName());
return storagePosManager.get(posId);
}
String storageId = task.getStorageId();
if(!Strings.isNullOrEmpty(storageId)){
if (!Strings.isNullOrEmpty(storageId)) {
Integer taskCount = storageTaskCountMap.get(storageId);
if(taskCount != null){
if (taskCount != null) {
taskCount = taskCount + 1;
storageTaskCountMap.put(storageId, taskCount);
}
if(task.isCheckOutTask()){
if (task.isCheckOutTask()) {
hasOutTaskStorageIds.add(storageId);
}
}
......@@ -587,14 +587,14 @@ public class TaskService {
//可用的料仓(在线,且可以放入)
List<Storage> availbleStorageList = new ArrayList<>();
for(Storage storage : storageList){
if(storage.canPutIn(barcode.getPlateSize(),barcode.getHeight())){
for (Storage storage : storageList) {
if (storage.canPutIn(barcode.getPlateSize(), barcode.getHeight())) {
availbleStorageList.add(storage);
}
}
if(availbleStorageList.isEmpty()){
throw new ValidateException("smfcode.noValidStorage","料仓列表中未找到可用的料仓");
if (availbleStorageList.isEmpty()) {
throw new ValidateException("smfcode.noValidStorage", "料仓列表中未找到可用的料仓");
}
availbleStorageList.sort(new Comparator<Storage>() {
......@@ -606,8 +606,7 @@ public class TaskService {
}
});
// return findEmptyPosInStorages(barcode, availbleStorageList, storageTaskCountMap,lastPosId);
return null;
return findEmptyPosInStorages(barcode, availbleStorageList, storageTaskCountMap, lastPosId);
}
private synchronized StoragePos findEmptyPosInStorages(Barcode barcode, List<Storage> availbleStorageList, final Map<String,Integer> executingTaskCountMap,String lastPosId){
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!