Commit 980761b1 hc

Merge remote-tracking branch 'origin/smf-core-21088' into smf-core-21088

2 个父辈 34946857 53978168
...@@ -1248,21 +1248,21 @@ public class LiteOrderCache { ...@@ -1248,21 +1248,21 @@ public class LiteOrderCache {
int taskReelCount = 0; int taskReelCount = 0;
//如果是hold的,判断有没有符合的条件 //如果是hold的,判断有没有符合的条件
List<StoragePos> storagePosList = new ArrayList<>(); List<StoragePos> holdPosList = new ArrayList<>();
if (isHold) { List<String> holdPosIdList = new ArrayList<>();
for (LiteOrderItem orderItem : cacheOrder.getOrderItems()) { for (LiteOrderItem orderItem : cacheOrder.getOrderItems()) {
List<FetchHoldInfoResult> resultList = LuxsanApi.fetchHoldInfo(new FetchHoldInfoRequest(CommonUtil.plantCode, orderItem.getSrcWarehouse(), orderItem.getPn())); List<FetchHoldInfoResult> resultList = LuxsanApi.fetchHoldInfo(new FetchHoldInfoRequest(CommonUtil.plantCode, orderItem.getSrcWarehouse(), orderItem.getPn()));
if (resultList != null && !resultList.isEmpty()) { if (resultList != null && !resultList.isEmpty()) {
List<String> palletIdList = resultList.stream().map(FetchHoldInfoResult::getPALLET_ID).collect(Collectors.toList()); List<String> palletIdList = resultList.stream().map(FetchHoldInfoResult::getPALLET_ID).collect(Collectors.toList());
List<Criteria> orCriterialList = Lists.newArrayList(); List<Criteria> orCriterialList = Lists.newArrayList();
orCriterialList.add(Criteria.where("barcode.barcode").in(palletIdList)); orCriterialList.add(Criteria.where("barcode.barcode").in(palletIdList));
orCriterialList.add(Criteria.where("barcode.palletId").is(palletIdList)); orCriterialList.add(Criteria.where("barcode.palletId").in(palletIdList));
Criteria c = new Criteria().orOperator(orCriterialList); Criteria c = new Criteria().orOperator(orCriterialList);
List<StoragePos> posList = storagePosManager.findByQuery(new Query(c)); List<StoragePos> posList = storagePosManager.findByQuery(new Query(c));
if (posList != null && !posList.isEmpty()){ if (posList != null && !posList.isEmpty()) {
for (StoragePos pos : posList) { for (StoragePos pos : posList) {
storagePosList.add(pos); holdPosList.add(pos);
} holdPosIdList.add(pos.getId());
} }
} }
} }
...@@ -1270,6 +1270,7 @@ public class LiteOrderCache { ...@@ -1270,6 +1270,7 @@ public class LiteOrderCache {
for (LiteOrderItem orderItem : cacheOrder.getOrderItems()) { for (LiteOrderItem orderItem : cacheOrder.getOrderItems()) {
String partNumber = orderItem.getPn(); String partNumber = orderItem.getPn();
...@@ -1286,13 +1287,14 @@ public class LiteOrderCache { ...@@ -1286,13 +1287,14 @@ public class LiteOrderCache {
StoragePos pos = null; StoragePos pos = null;
String loc = TaskLocUtil.MW; String loc = TaskLocUtil.MW;
if (isHold) { if (isHold) {
if (storagePosList != null && !storagePosList.isEmpty()) { if (holdPosList != null && !holdPosList.isEmpty()) {
for (StoragePos storagePos : storagePosList) { for (StoragePos storagePos : holdPosList) {
if (excludePosIds.contains(storagePos.getId())) { if (excludePosIds.contains(storagePos.getId())) {
continue; continue;
} }
if (partNumber.equals(storagePos.getBarcode().getPartNumber())) { Barcode barcode = storagePos.getBarcode();
if (orderItem.getSrcWarehouse().equals(storagePos.getBarcode().getWarehouseCode())) { if (partNumber.equals(barcode.getPartNumber())) {
if (orderItem.getSrcWarehouse().equals(barcode.getWarehouseCode())) {
pos = storagePos; pos = storagePos;
break; break;
} }
...@@ -1300,6 +1302,7 @@ public class LiteOrderCache { ...@@ -1300,6 +1302,7 @@ public class LiteOrderCache {
} }
} }
} else { } else {
excludePosIds.addAll(holdPosIdList);
pos = storagePosManager.findPartNumberInStorages(storageIdList, partNumber, excludePosIds, checkoutType, orderItem.getBrand(),orderItem.getSrcWarehouse()); pos = storagePosManager.findPartNumberInStorages(storageIdList, partNumber, excludePosIds, checkoutType, orderItem.getBrand(),orderItem.getSrcWarehouse());
} }
if (pos == null) { if (pos == null) {
......
...@@ -380,8 +380,8 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -380,8 +380,8 @@ public class StoragePosManagerImpl implements IStoragePosManager {
public StoragePos findPartNumberInStorages(List<String> storageIdList, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType, String brand,String wareHouseCode){ public StoragePos findPartNumberInStorages(List<String> storageIdList, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType, String brand,String wareHouseCode){
Criteria c = Criteria.where("barcode.partNumber").is(pn) Criteria c = Criteria.where("barcode.partNumber").is(pn)
.and("id").nin(excludePosIds) .and("id").nin(excludePosIds)
.and("enabled").is(true)//可用 .and("enabled").is(true);//可用
.and("barcode.lockId").is(null);//没有被锁定的仓位; //.and("barcode.lockId").is(null);//没有被锁定的仓位;
if (storageIdList != null) { if (storageIdList != null) {
c = c.and("storageId").in(storageIdList); c = c.and("storageId").in(storageIdList);
} }
......
...@@ -676,7 +676,7 @@ public class OutLineController { ...@@ -676,7 +676,7 @@ public class OutLineController {
labelList.add(tickPick); labelList.add(tickPick);
request.setLABEL_LIST(labelList); request.setLABEL_LIST(labelList);
LuxsanApi.ticketPick(request); LuxsanApi.ticketPick(request);
LuxsanApi.ticketPost(new TicketPostRequest(CommonUtil.plantCode,orderItem.getTicketCode())); //LuxsanApi.ticketPost(new TicketPostRequest(CommonUtil.plantCode,orderItem.getTicketCode()));
} }
else if (liteOrder.getCheckType() == LiteorderCheckType.PICKING_CHECKOUT){ else if (liteOrder.getCheckType() == LiteorderCheckType.PICKING_CHECKOUT){
......
...@@ -321,7 +321,6 @@ public class LuxsanApi extends DefaultSmfApiListener { ...@@ -321,7 +321,6 @@ public class LuxsanApi extends DefaultSmfApiListener {
log.error("ticketPost请求失败:" + e.getMessage()); log.error("ticketPost请求失败:" + e.getMessage());
throw new ValidateException("smfcore.api.error", "接口请求失败[{0}]", new String[]{e.getMessage()}); throw new ValidateException("smfcore.api.error", "接口请求失败[{0}]", new String[]{e.getMessage()});
} }
throw new ValidateException("smfcore.api.error", "接口请求失败[{0}]", new String[]{"未找到对应的单据挑料信息"});
} }
......
...@@ -19,4 +19,6 @@ public class BinMoveRequest { ...@@ -19,4 +19,6 @@ public class BinMoveRequest {
private int QTY; private int QTY;
private String LABEL_ID;
} }
...@@ -221,12 +221,12 @@ public class CDeviceController { ...@@ -221,12 +221,12 @@ public class CDeviceController {
//储位移转 //储位移转
else if (MaterialUtil.storTransfer(materialStr)){ else if (MaterialUtil.storTransfer(materialStr)){
BinMoveResult binMoveResult = LuxsanApi.binMove(new BinMoveRequest(CommonUtil.plantCode, binCodeStr, Arrays.asList(barcode.getBarcode()), barcode.getAmount())); BinMoveResult binMoveResult = LuxsanApi.binMove(new BinMoveRequest(CommonUtil.plantCode, binCodeStr, Arrays.asList(barcode.getBarcode()), barcode.getAmount(),barcode.getLabelId()));
if (StringUtils.isNotEmpty(binMoveResult.getGR_DATE())){ if (StringUtils.isNotEmpty(binMoveResult.getGR_DATE())){
Date grDate = DateUtil.getNoTimeDate(binMoveResult.getGR_DATE()); Date grDate = DateUtil.getNoTimeDate(binMoveResult.getGR_DATE());
barcode.setProduceDate(grDate); barcode.setProduceDate(grDate);
} }
barcode.setLabelId(binMoveResult.getLABEL_ID()); //barcode.setLabelId(binMoveResult.getLABEL_ID());
} }
//311单据转库 //311单据转库
...@@ -246,7 +246,7 @@ public class CDeviceController { ...@@ -246,7 +246,7 @@ public class CDeviceController {
labelList.add(tickPick); labelList.add(tickPick);
request.setLABEL_LIST(labelList); request.setLABEL_LIST(labelList);
LuxsanApi.ticketPick(request); LuxsanApi.ticketPick(request);
LuxsanApi.ticketPost(new TicketPostRequest(CommonUtil.plantCode,transfer.getTicket())); //LuxsanApi.ticketPost(new TicketPostRequest(CommonUtil.plantCode,transfer.getTicket()));
} }
//单据退库上架 //单据退库上架
......
...@@ -231,7 +231,7 @@ public class TicketController { ...@@ -231,7 +231,7 @@ public class TicketController {
String srcWarehouseCode = paramMap.get("srcWarehouseCode"); //来源库别 String srcWarehouseCode = paramMap.get("srcWarehouseCode"); //来源库别
String codeStr = paramMap.get("codeStr"); //料盘信息 String codeStr = paramMap.get("codeStr"); //料盘信息
log.info("单据退料绑定信息为:" + JSON.toJSONString(paramMap)); log.info("单据转库绑定信息为:" + JSON.toJSONString(paramMap));
//判断料串信息是否正确 //判断料串信息是否正确
if (StringUtils.isEmpty(materialStr) || !materialStr.startsWith("B00")) { if (StringUtils.isEmpty(materialStr) || !materialStr.startsWith("B00")) {
......
...@@ -71,10 +71,10 @@ public class AgvDeviceController { ...@@ -71,10 +71,10 @@ public class AgvDeviceController {
if (StringUtils.isEmpty(dataLog.getLoc())) { if (StringUtils.isEmpty(dataLog.getLoc())) {
dataLog.setLoc(TaskLocUtil.OUT); dataLog.setLoc(TaskLocUtil.OUT);
} }
}
dataLogList.add(dataLog); dataLogList.add(dataLog);
} }
} }
}
return dataLogList; return dataLogList;
} }
...@@ -130,11 +130,11 @@ public class AgvDeviceController { ...@@ -130,11 +130,11 @@ public class AgvDeviceController {
task.setStatus(statusStr); task.setStatus(statusStr);
taskService.updateQueueTask(task); taskService.updateQueueTask(task);
} else { } else {
taskService.moveTaskToFinished(task);
if (!task.isOutFromPos()) { if (!task.isOutFromPos()) {
finishedOutTask(task); finishedOutTask(task);
//WipBoxHandleUtil.outFromPos(task); //WipBoxHandleUtil.outFromPos(task);
task.setOutFromPos(true); task.setOutFromPos(true);
taskService.moveTaskToFinished(task);
taskService.updateFinishedTask(task); taskService.updateFinishedTask(task);
} }
if (OP_STATUS.FINISHED.name().equals(statusStr)) { if (OP_STATUS.FINISHED.name().equals(statusStr)) {
...@@ -182,7 +182,7 @@ public class AgvDeviceController { ...@@ -182,7 +182,7 @@ public class AgvDeviceController {
palletUpdateRequest.setBIN_CODE("SWCT"); palletUpdateRequest.setBIN_CODE("SWCT");
palletUpdateRequest.setBIZ_TYPE("M"); palletUpdateRequest.setBIZ_TYPE("M");
palletUpdateRequest.setPLANT_CODE(CommonUtil.plantCode); palletUpdateRequest.setPLANT_CODE(CommonUtil.plantCode);
LuxsanApi.palletUpdate(palletUpdateRequest); //LuxsanApi.palletUpdate(palletUpdateRequest);
//已完成,从库存中清除,并且从完成队列中清除 //已完成,从库存中清除,并且从完成队列中清除
......
...@@ -250,12 +250,7 @@ public class LineController { ...@@ -250,12 +250,7 @@ public class LineController {
log.info(boxId+"任务需要改成FINISHED"); log.info(boxId+"任务需要改成FINISHED");
soureId = task.getSourceId(); soureId = task.getSourceId();
sourceName = task.getSourceName(); sourceName = task.getSourceName();
if (!task.isFinished()){
task.setStatus(OP_STATUS.FINISHED.name());
}
dataLog = task; dataLog = task;
taskService.moveTaskToFinished(task);
taskService.updateFinishedTask(task);
break; break;
} }
} }
...@@ -270,6 +265,12 @@ public class LineController { ...@@ -270,6 +265,12 @@ public class LineController {
if (dataLog != null) { if (dataLog != null) {
if (!dataLog.isFinished()){
dataLog.setStatus(OP_STATUS.FINISHED.name());
taskService.moveTaskToFinished(dataLog);
taskService.updateFinishedTask(dataLog);
}
int num = 0; int num = 0;
List<DataLog> dataLogList = taskService.getAllTasks(); List<DataLog> dataLogList = taskService.getAllTasks();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!