Commit ec6fe17e zshaohui

uid出库卡机种出库

1 个父辈 f4b8321b
......@@ -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()){
for (Barcode subCode : subCodeList){
if (disablePosNameList.contains(subCode.getPosName())) {
......@@ -1733,7 +1733,7 @@ public class LiteOrderCache {
//禁用的物料信息
List<String> batchCheckReelList = LuxsanApi.batchCheckReel(subCodeList);
List<String> batchCheckReelList = LuxsanApi.batchCheckReel(subCodeList,"","");
if (batchCheckReelList != null && !batchCheckReelList.isEmpty()){
for (Barcode subCode : subCodeList){
if (disablePosNameList.contains(subCode.getPosName())) {
......@@ -1962,7 +1962,7 @@ public class LiteOrderCache {
//禁用的物料信息
List<String> batchCheckReelList = LuxsanApi.batchCheckReel(subCodeList);
List<String> batchCheckReelList = LuxsanApi.batchCheckReel(subCodeList,"","");
if (batchCheckReelList != null && !batchCheckReelList.isEmpty()) {
for (String reelId : batchCheckReelList) {
if (!disableReelList.contains(reelId)) {
......
package com.neotel.smfcore.core.storage.rest;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.neotel.smfcore.common.base.IExcelDownLoad;
......@@ -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.util.TaskService;
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.siemens.SiemensApi;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
......@@ -529,9 +531,11 @@ public class StoragePosController {
String warehouseCode = criteria.getWarehouseCode();
String box = criteria.getBox();
String partNumber = criteria.getPartNumber();
if (StringUtils.isBlank(stationName)) {
return ResultBean.newErrorResult(-1, "", "请选择对应的位置");
}
if (StringUtils.isBlank(partNumber)
&& StringUtils.isBlank(provider)
&& StringUtils.isBlank(batch)
......@@ -540,109 +544,144 @@ public class StoragePosController {
&& StringUtils.isBlank(box)) {
return ResultBean.newErrorResult(-1, "", "请核实查询条件是否为空");
}
String model = criteria.getMachineTypes();
if (StringUtils.isEmpty(model)) {
return ResultBean.newErrorResult(-1, "", "请选择对应的机种");
}
Query query = getPosFindCriteria(criteria);
List<StoragePos> storagePoss = storagePosManager.findByQuery(query);
//判断是否有出库任务
boolean hasOutReel = false;
if (storagePoss != null && !storagePoss.isEmpty()) {
String selectMsg = getSelectMsg(partNumber, provider, batch, dateCode);
for (StoragePos pos : storagePoss) {
//先把里边的物料进行标识
Barcode pidBarcode = pos.getBarcode();
if (StringUtils.isNotBlank(box)) {
if (!box.equals(pidBarcode.getBarcode())) {
continue;
List<StoragePos> storagePosList = storagePosManager.findByQuery(query);
if (storagePosList == null || storagePosList.isEmpty()) {
return ResultBean.newErrorResult(-1, "", "未找到可以出库的物料");
}
for (StoragePos pos : storagePosList) {
//排除正在执行的库位
Collection<String> excludePosIds = taskService.excludePosIds();
if (excludePosIds != null && !excludePosIds.isEmpty() && excludePosIds.contains(pos.getId())) {
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 (excludePosIds != null && !excludePosIds.isEmpty() && excludePosIds.contains(pos.getId())) {
log.info("库位:" + pos.getPosName() + "正在执行,跳过");
continue;
}
hasOutReel = true;
List<Barcode> subCodeList = pidBarcode.getSubCodeList();
if (subCodeList != null && !subCodeList.isEmpty()) {
for (Barcode barcode : subCodeList) {
if (barcode.isOut()) {
//判断供应商是否相同
if (StringUtils.isNotBlank(provider)) {
if (!subCode.getProvider().equals(provider)) {
continue;
}
List<String> partNumberList = criteria.getPartNumberList();
if (partNumberList != null && !partNumberList.isEmpty()) {
boolean hasCont = false;
for (String pn : partNumberList) {
if (barcode.getPartNumber().startsWith(pn)){
hasCont = true;
break;
}
}
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> batchList = criteria.getBatchList();
if (batchList != null && !batchList.isEmpty()) {
if (!batchList.contains(subCode.getBatch())) {
continue;
}
List<String> dateCodeList = criteria.getDateCodeList();
if (dateCodeList != null && !dateCodeList.isEmpty()) {
if (!dateCodeList.contains(barcode.getDateCode())) {
continue;
}
}
//判断dc是否相同
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);
pos.setBarcode(pidBarcode);
storagePosManager.save(pos);
//判断PN是否相同
List<String> partNumberList = criteria.getPartNumberList();
if (partNumberList != null && !partNumberList.isEmpty()) {
if (!partNumberList.contains(subCode.getPartNumber())) {
continue;
}
}
needOutList.add(subCode);
}
}
if (hasOutReel) {
Barcode barcode = pos.getBarcode();
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());
if (storage.isVirtual()){
task.setExtendType(ExtendType.VIRTUAL_CHECKOUT);
} else {
task.setExtendType(ExtendType.STORAGE_CHECKOUT);
//如果要出库的物料为空,抛出异常
if (needOutList == null || needOutList.isEmpty()) {
log.info("料箱为:" + barcode.getBarcode() + "库位为:" + pos.getPosName() + ",没有找到要出库的物料");
continue;
}
//批量校验是否可以出库
List<String> disPosNameList = new ArrayList<>();
List<String> batchCheckReelList = LuxsanApi.batchCheckReel(needOutList, "", model);
if (batchCheckReelList != null || batchCheckReelList.isEmpty()) {
for (String reelId : batchCheckReelList) {
for (Barcode subCode : subCodeList) {
if (disPosNameList.contains(subCode.getPosName())) {
continue;
}
if (reelId.equals(subCode.getBarcode())) {
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 {
private String boxStatus;
private String machineTypes;
@ApiModelProperty("料箱状态,是否在库")
@QueryCondition(type = QueryCondition.Type.IN,propName = "barcode.status")
private List<Integer> boxStatusList;
......
......@@ -1080,12 +1080,8 @@ public class LuxsanApi extends DefaultSmfApiListener {
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<>();
for (Barcode barcode : barcodeList) {
Map<String,Object> paramMap = new HashMap<>();
......@@ -1098,7 +1094,13 @@ public class LuxsanApi extends DefaultSmfApiListener {
paramMap.put("remark","ALL");
paramMap.put("werks","ALL");
paramMap.put("model","ALL");
if (StringUtils.isNotEmpty(model)){
paramMap.put("model",model);
}
paramMap.put("picking","ALL");
if (StringUtils.isNotEmpty(pickingId)){
paramMap.put("picking",pickingId);
}
paramList.add(paramMap);
}
log.info("批量禁用入参为:"+JSON.toJSONString(paramList));
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!