Commit ec6fe17e zshaohui

uid出库卡机种出库

1 个父辈 f4b8321b
...@@ -1015,7 +1015,7 @@ public class LiteOrderCache { ...@@ -1015,7 +1015,7 @@ public class LiteOrderCache {
//禁用的物料信息 //禁用的物料信息
List<String> batchCheckReelList = LuxsanApi.batchCheckReel(subCodeList); List<String> batchCheckReelList = LuxsanApi.batchCheckReel(subCodeList,orderNo,"");
if (batchCheckReelList != null && !batchCheckReelList.isEmpty()){ if (batchCheckReelList != null && !batchCheckReelList.isEmpty()){
for (Barcode subCode : subCodeList){ for (Barcode subCode : subCodeList){
if (disablePosNameList.contains(subCode.getPosName())) { if (disablePosNameList.contains(subCode.getPosName())) {
...@@ -1733,7 +1733,7 @@ public class LiteOrderCache { ...@@ -1733,7 +1733,7 @@ public class LiteOrderCache {
//禁用的物料信息 //禁用的物料信息
List<String> batchCheckReelList = LuxsanApi.batchCheckReel(subCodeList); List<String> batchCheckReelList = LuxsanApi.batchCheckReel(subCodeList,"","");
if (batchCheckReelList != null && !batchCheckReelList.isEmpty()){ if (batchCheckReelList != null && !batchCheckReelList.isEmpty()){
for (Barcode subCode : subCodeList){ for (Barcode subCode : subCodeList){
if (disablePosNameList.contains(subCode.getPosName())) { if (disablePosNameList.contains(subCode.getPosName())) {
...@@ -1962,7 +1962,7 @@ public class LiteOrderCache { ...@@ -1962,7 +1962,7 @@ public class LiteOrderCache {
//禁用的物料信息 //禁用的物料信息
List<String> batchCheckReelList = LuxsanApi.batchCheckReel(subCodeList); List<String> batchCheckReelList = LuxsanApi.batchCheckReel(subCodeList,"","");
if (batchCheckReelList != null && !batchCheckReelList.isEmpty()) { if (batchCheckReelList != null && !batchCheckReelList.isEmpty()) {
for (String reelId : batchCheckReelList) { for (String reelId : batchCheckReelList) {
if (!disableReelList.contains(reelId)) { if (!disableReelList.contains(reelId)) {
......
package com.neotel.smfcore.core.storage.rest; package com.neotel.smfcore.core.storage.rest;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
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.base.IExcelDownLoad; import com.neotel.smfcore.common.base.IExcelDownLoad;
...@@ -34,6 +35,7 @@ import com.neotel.smfcore.core.storage.service.po.StoragePos; ...@@ -34,6 +35,7 @@ import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.core.system.service.po.DataLog; import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.TaskService; import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType; import com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType;
import com.neotel.smfcore.custom.luxsan.api.LuxsanApi;
import com.neotel.smfcore.custom.luxsan.factory_c.common.util.DisableBarcodeUtil; import com.neotel.smfcore.custom.luxsan.factory_c.common.util.DisableBarcodeUtil;
import com.neotel.smfcore.custom.siemens.SiemensApi; import com.neotel.smfcore.custom.siemens.SiemensApi;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
...@@ -529,9 +531,11 @@ public class StoragePosController { ...@@ -529,9 +531,11 @@ public class StoragePosController {
String warehouseCode = criteria.getWarehouseCode(); String warehouseCode = criteria.getWarehouseCode();
String box = criteria.getBox(); String box = criteria.getBox();
String partNumber = criteria.getPartNumber(); String partNumber = criteria.getPartNumber();
if (StringUtils.isBlank(stationName)) { if (StringUtils.isBlank(stationName)) {
return ResultBean.newErrorResult(-1, "", "请选择对应的位置"); return ResultBean.newErrorResult(-1, "", "请选择对应的位置");
} }
if (StringUtils.isBlank(partNumber) if (StringUtils.isBlank(partNumber)
&& StringUtils.isBlank(provider) && StringUtils.isBlank(provider)
&& StringUtils.isBlank(batch) && StringUtils.isBlank(batch)
...@@ -540,109 +544,144 @@ public class StoragePosController { ...@@ -540,109 +544,144 @@ public class StoragePosController {
&& StringUtils.isBlank(box)) { && StringUtils.isBlank(box)) {
return ResultBean.newErrorResult(-1, "", "请核实查询条件是否为空"); return ResultBean.newErrorResult(-1, "", "请核实查询条件是否为空");
} }
String model = criteria.getMachineTypes();
if (StringUtils.isEmpty(model)) {
return ResultBean.newErrorResult(-1, "", "请选择对应的机种");
}
Query query = getPosFindCriteria(criteria); Query query = getPosFindCriteria(criteria);
List<StoragePos> storagePoss = storagePosManager.findByQuery(query);
List<StoragePos> storagePosList = storagePosManager.findByQuery(query);
//判断是否有出库任务 if (storagePosList == null || storagePosList.isEmpty()) {
boolean hasOutReel = false; return ResultBean.newErrorResult(-1, "", "未找到可以出库的物料");
if (storagePoss != null && !storagePoss.isEmpty()) { }
String selectMsg = getSelectMsg(partNumber, provider, batch, dateCode);
for (StoragePos pos : storagePoss) { for (StoragePos pos : storagePosList) {
//先把里边的物料进行标识
Barcode pidBarcode = pos.getBarcode(); //排除正在执行的库位
if (StringUtils.isNotBlank(box)) { Collection<String> excludePosIds = taskService.excludePosIds();
if (!box.equals(pidBarcode.getBarcode())) { if (excludePosIds != null && !excludePosIds.isEmpty() && excludePosIds.contains(pos.getId())) {
continue; log.info("库位:" + pos.getPosName() + "正在执行,跳过");
continue;
}
Barcode barcode = pos.getBarcode();
//判断有没有输入箱子号
if (StringUtils.isNotEmpty(box) && !box.equals(barcode.getBarcode())) {
continue;
}
//开始循环遍历出库的料箱
List<Barcode> needOutList = new ArrayList<>();
List<Barcode> subCodeList = barcode.getSubCodeList();
if (subCodeList != null && !subCodeList.isEmpty()) {
for (Barcode subCode : subCodeList) {
if (subCode.isOut()) {
log.info("当前物料已经被标记出库:" + subCode.getBarcode() + "所在料箱为:" + barcode.getBarcode() + "所在库位为:" + pos.getPosName());
} }
}
//排除正在执行的库位 //判断供应商是否相同
Collection<String> excludePosIds = taskService.excludePosIds(); if (StringUtils.isNotBlank(provider)) {
if (excludePosIds != null && !excludePosIds.isEmpty() && excludePosIds.contains(pos.getId())) { if (!subCode.getProvider().equals(provider)) {
log.info("库位:" + pos.getPosName() + "正在执行,跳过");
continue;
}
hasOutReel = true;
List<Barcode> subCodeList = pidBarcode.getSubCodeList();
if (subCodeList != null && !subCodeList.isEmpty()) {
for (Barcode barcode : subCodeList) {
if (barcode.isOut()) {
continue; continue;
} }
List<String> partNumberList = criteria.getPartNumberList(); }
if (partNumberList != null && !partNumberList.isEmpty()) {
boolean hasCont = false; //判断批次是否相同
for (String pn : partNumberList) { List<String> batchList = criteria.getBatchList();
if (barcode.getPartNumber().startsWith(pn)){ if (batchList != null && !batchList.isEmpty()) {
hasCont = true; if (!batchList.contains(subCode.getBatch())) {
break; continue;
}
}
if (!hasCont){
continue;
}
}
if (StringUtils.isNotBlank(provider)) {
if (!barcode.getProvider().equals(provider)) {
continue;
}
}
List<String> batchList = criteria.getBatchList();
if (batchList != null && !batchList.isEmpty()) {
if (!batchList.contains(barcode.getBatch())) {
continue;
}
} }
List<String> dateCodeList = criteria.getDateCodeList(); }
if (dateCodeList != null && !dateCodeList.isEmpty()) {
if (!dateCodeList.contains(barcode.getDateCode())) { //判断dc是否相同
continue; List<String> dateCodeList = criteria.getDateCodeList();
} if (dateCodeList != null && !dateCodeList.isEmpty()) {
if (!dateCodeList.contains(subCode.getDateCode())) {
continue;
} }
if (StringUtils.isNotBlank(warehouseCode)) { }
if (!warehouseCode.equals(barcode.getWarehouseCode())) {
continue; //判断库别是否相同
} if (StringUtils.isNotBlank(warehouseCode)) {
if (!warehouseCode.equals(subCode.getWarehouseCode())) {
continue;
} }
barcode.setOut(true);
barcode.setSelectMsg(selectMsg);
//保存信息
barcode = barcodeManager.save(barcode);
pidBarcode.UpdateSubCode(barcode);
} }
barcodeManager.saveBarcode(pidBarcode); //判断PN是否相同
pos.setBarcode(pidBarcode); List<String> partNumberList = criteria.getPartNumberList();
storagePosManager.save(pos); if (partNumberList != null && !partNumberList.isEmpty()) {
if (!partNumberList.contains(subCode.getPartNumber())) {
continue;
}
}
needOutList.add(subCode);
} }
}
if (hasOutReel) { //如果要出库的物料为空,抛出异常
Barcode barcode = pos.getBarcode(); if (needOutList == null || needOutList.isEmpty()) {
Storage storage = dataCache.getStorageById(pos.getStorageId()); log.info("料箱为:" + barcode.getBarcode() + "库位为:" + pos.getPosName() + ",没有找到要出库的物料");
DataLog task = new DataLog(storage,barcode , pos); continue;
task.setType(OP.CHECKOUT); }
task.setPutInDate(pos.getBarcode().getPutInDate());
task.setStatus(OP_STATUS.WAIT.name()); //批量校验是否可以出库
task.setSingleOut(false); List<String> disPosNameList = new ArrayList<>();
task.setOperator(SecurityUtils.getCurrentUsername());
task.setStorageId(pos.getStorageId()); List<String> batchCheckReelList = LuxsanApi.batchCheckReel(needOutList, "", model);
if (StringUtils.isNotBlank(stationName)) { if (batchCheckReelList != null || batchCheckReelList.isEmpty()) {
task.setLoc(stationName); for (String reelId : batchCheckReelList) {
} for (Barcode subCode : subCodeList) {
task.setBoxPosName(pos.getPosName()); if (disPosNameList.contains(subCode.getPosName())) {
if (storage.isVirtual()){ continue;
task.setExtendType(ExtendType.VIRTUAL_CHECKOUT); }
} else { if (reelId.equals(subCode.getBarcode())) {
task.setExtendType(ExtendType.STORAGE_CHECKOUT); log.info(reelId + "为禁用料,隔口为:" + subCode.getPosName() + "库位为:" + pos.getPosName());
disPosNameList.add(subCode.getPosName());
}
} }
task.setCartonId(barcode.getCartonId());
taskService.updateQueueTask(task);
} }
} }
if (hasOutReel) {
return ResultBean.newOkResult(""); //开始标记,生成出库任务
boolean hasOutTask = false;
for (Barcode needOutBarcode : needOutList) {
if (disPosNameList.contains(needOutBarcode.getPosName())) {
continue;
}
hasOutTask = true;
needOutBarcode.setOut(true);
needOutBarcode = barcodeManager.save(needOutBarcode);
barcode.UpdateSubCode(needOutBarcode);
}
if (hasOutTask) {
barcodeManager.saveBarcode(barcode);
pos.setBarcode(barcode);
storagePosManager.save(pos);
//生成出库任务
Storage storage = dataCache.getStorageById(pos.getStorageId());
DataLog task = new DataLog(storage, barcode, pos);
task.setType(OP.CHECKOUT);
task.setPutInDate(pos.getBarcode().getPutInDate());
task.setStatus(OP_STATUS.WAIT.name());
task.setSingleOut(false);
task.setOperator(SecurityUtils.getCurrentUsername());
task.setStorageId(pos.getStorageId());
if (StringUtils.isNotBlank(stationName)) {
task.setLoc(stationName);
}
task.setBoxPosName(pos.getPosName());
task.setCartonId(barcode.getCartonId());
taskService.updateQueueTask(task);
} }
} }
return ResultBean.newErrorResult(-1, "", "未找到可以出库的物料"); return ResultBean.newOkResult("");
} }
......
...@@ -105,6 +105,8 @@ public class StoragePosFindCriteria { ...@@ -105,6 +105,8 @@ public class StoragePosFindCriteria {
private String boxStatus; private String boxStatus;
private String machineTypes;
@ApiModelProperty("料箱状态,是否在库") @ApiModelProperty("料箱状态,是否在库")
@QueryCondition(type = QueryCondition.Type.IN,propName = "barcode.status") @QueryCondition(type = QueryCondition.Type.IN,propName = "barcode.status")
private List<Integer> boxStatusList; private List<Integer> boxStatusList;
......
...@@ -1080,12 +1080,8 @@ public class LuxsanApi extends DefaultSmfApiListener { ...@@ -1080,12 +1080,8 @@ public class LuxsanApi extends DefaultSmfApiListener {
return result; return result;
} }
public static void main(String[] args) {
List<String> batchCheckReel = batchCheckReel(new ArrayList<>());
System.out.println(JSON.toJSONString(batchCheckReel));
}
public static List<String> batchCheckReel(List<Barcode> barcodeList) { public static List<String> batchCheckReel(List<Barcode> barcodeList,String pickingId,String model) {
List<Map<String,Object>> paramList = new ArrayList<>(); List<Map<String,Object>> paramList = new ArrayList<>();
for (Barcode barcode : barcodeList) { for (Barcode barcode : barcodeList) {
Map<String,Object> paramMap = new HashMap<>(); Map<String,Object> paramMap = new HashMap<>();
...@@ -1098,7 +1094,13 @@ public class LuxsanApi extends DefaultSmfApiListener { ...@@ -1098,7 +1094,13 @@ public class LuxsanApi extends DefaultSmfApiListener {
paramMap.put("remark","ALL"); paramMap.put("remark","ALL");
paramMap.put("werks","ALL"); paramMap.put("werks","ALL");
paramMap.put("model","ALL"); paramMap.put("model","ALL");
if (StringUtils.isNotEmpty(model)){
paramMap.put("model",model);
}
paramMap.put("picking","ALL"); paramMap.put("picking","ALL");
if (StringUtils.isNotEmpty(pickingId)){
paramMap.put("picking",pickingId);
}
paramList.add(paramMap); paramList.add(paramMap);
} }
log.info("批量禁用入参为:"+JSON.toJSONString(paramList)); log.info("批量禁用入参为:"+JSON.toJSONString(paramList));
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!