Commit a64f9515 zshaohui

获取可用料格 增加忽略当前工位的料箱

1 个父辈 73ec6ee2
......@@ -40,6 +40,7 @@ import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.MaterialUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.common.util.CommonUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.third.util.MaterialLocUtil;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -454,7 +455,8 @@ public class CDeviceController {
@RequestMapping("/reelCheckOut")
@AnonymousAccess
public synchronized ResultBean reelCheckOut(@RequestParam("boxStr") String boxStr,
@RequestParam("isNormal") boolean isNormal) {
@RequestParam("isNormal") boolean isNormal,
@RequestParam("materialStr") String materialStr) {
//1.解析条码内容
//Barcode binCode = codeResolve.resolveOneValideBarcode(boxStr);
......@@ -628,6 +630,9 @@ public class CDeviceController {
barcode.setBarSource("");
barcodeManager.saveBarcode(barcode);
//更新料串缓存信息
MaterialLocUtil.updateMaterialLoc(materialStr,"",barcode);
Map<String,String> resultMap = new HashMap<>();
resultMap.put("binCode",boxStr);
resultMap.put("seq",seq+"");
......@@ -667,8 +672,13 @@ public class CDeviceController {
String source = paramMap.get("source");
String needBinCodeStr = paramMap.get("needBinCodeStr");
String ignoreWorkStr = paramMap.get("ignoreWorkBox");
boolean ignoreWorkBox = Boolean.valueOf(ignoreWorkStr);
List<String> validBinList = new ArrayList<String>();
log.info("入料机构获取料串[" + stackerId + "]的可用料格[" + binListStr + "],入料机构为[" + source + "],需要的料格信息为:"+needBinCodeStr);
log.info("入料机构获取料串[" + stackerId + "]的可用料格[" + binListStr + "],入料机构为[" + source + "],需要的料格信息为:"+needBinCodeStr+",是否忽略当前工作的料箱:"+ignoreWorkStr);
if (!MaterialUtil.bindInfo(stackerId)) {
return ResultBean.newErrorResult(-1, "error.nobind", "料串[" + stackerId + "]未绑定任何信息");
......@@ -731,7 +741,7 @@ public class CDeviceController {
Map<String,Object> dataMap = new HashMap<>();
dataMap.put("validBinList",validBinList);*/
ValidBin validBin = BinCacheUtil.validBin(stackerBarcode, source, binListStr,needBinCodeStr);
ValidBin validBin = BinCacheUtil.validBin(stackerBarcode, source, binListStr,needBinCodeStr,ignoreWorkBox);
if (validBin == null){
return ResultBean.newErrorResult(-1,"",stackerId+"未找到可用料箱");
}
......
......@@ -94,7 +94,7 @@ public class BinCacheUtil {
}
public synchronized static ValidBin validBin(Barcode stackerBarcode, String source, String binListStr,String needBinCodeStr) {
public synchronized static ValidBin validBin(Barcode stackerBarcode, String source, String binListStr,String needBinCodeStr,boolean ignoreWorkBox) {
String boxCode = "";
String boxLoc = "";
......@@ -165,15 +165,18 @@ public class BinCacheUtil {
log.info("未找到当前工作的料格,开始寻找正在当前工位上的料箱");
List<String> emptyBoxList = new ArrayList<>();
if (ignoreWorkBox) {
List<DataLog> allTasks = taskService.getAllTasks();
for (DataLog dataLog : allTasks) {
if (dataLog.isCheckOutTask() && !dataLog.isCancel() && !dataLog.isFinished()) {
if (source.equals(dataLog.getCurrentLoc())) {
log.info(barcode+"找到当前工位上的料箱为:" + dataLog.getBarcode() + ",位置为:" + dataLog.getCurrentLoc());
log.info(barcode + "找到当前工位上的料箱为:" + dataLog.getBarcode() + ",位置为:" + dataLog.getCurrentLoc());
emptyBoxList.add(dataLog.getBarcode());
}
}
}
}
if (emptyBoxList != null && !emptyBoxList.isEmpty()) {
for (String boxStr : emptyBoxList) {
......
......@@ -64,7 +64,7 @@ public class RestoreReplaceController {
.and("id").nin(liteOrderCache.excludeOutPosIds())
.and("enabled").is(true)
.and("barcode.lockId").is(null)
.and("barcode.amount").gte(amount);
.and("barcode.amount").is(amount);
Sort s = Sort.by(Sort.Direction.ASC, "barcode.amount", "barcode.putInDate");
StoragePos pos = storagePosDao.findOne(new Query(c).with(s));
if (pos == null) {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!