Commit 3a1e51a9 LN

扫码亮灯修改

1 个父辈 9eedf462
...@@ -627,7 +627,29 @@ public class TaskShelfUtil { ...@@ -627,7 +627,29 @@ public class TaskShelfUtil {
} }
return true; return true;
} }
public static boolean CloseShelfLed(ShelfInfo shelfInfo) {
List<ShelfLoc> locs = shelfInfo.getLocList();
String shelfLoc = getShelfLoc(shelfInfo.getRealRfid());
String cid=getCid(shelfLoc);
Storage storage = dataCache.getStorage(cid);
if (storage == null) {
log.error("CloseShelfLed 料架[" + shelfInfo.getRealRfid() + "] , 位置:[" + shelfLoc + "],cid ["+cid+" ]未找到对应的亮灯料架");
return false;
}
for (ShelfLoc loc : locs
) {
String posname = loc.getPosName(shelfLoc);
if (loc.isEmpty() || ObjectUtil.isEmpty(loc.getBarcode())) {
continue;
}
if (loc.isReelLeave()) {
DevicesStatusUtil.appendOp(storage.getCid(), "close", posname + "=" + "");
log.info("亮灯料架CID:[" + storage.getCid() + "],料架RFID:[" + shelfInfo.getRealRfid() + "] ,关闭库位灯: [clsoe :" + posname + "=]" );
}
}
return true;
}
/** /**
* 扫码亮灯,获取库位号 * 扫码亮灯,获取库位号
* @param barcode * @param barcode
...@@ -663,13 +685,15 @@ public class TaskShelfUtil { ...@@ -663,13 +685,15 @@ public class TaskShelfUtil {
} }
} }
shelf.NeedLeaveLine(); if(lightEnd){
shelf.NeedLeaveLine();
}
updateShelfInfo(shelf); updateShelfInfo(shelf);
log.info("标记料架[" + shelf.getRealRfid() + "]位置[" + shelfLoc.getLoc() + "]条码[" + shelfLoc.getBarcode() + "]已扫码灭灯,料盘已离开,料架是否亮灯完成["+lightEnd+"]"); log.info("标记料架[" + shelf.getRealRfid() + "]位置[" + shelfLoc.getLoc() + "]条码[" + shelfLoc.getBarcode() + "]已扫码灭灯,料盘已离开,料架是否亮灯完成["+lightEnd+"]");
list.add(shelf); list.add(shelf);
list.add(shelfLoc); list.add(shelfLoc);
// return shelfLoc; return list;
} }
......
...@@ -184,6 +184,16 @@ public class StorageController { ...@@ -184,6 +184,16 @@ public class StorageController {
storageDtos=updateDtos(storageDtos); storageDtos=updateDtos(storageDtos);
return storageDtos; return storageDtos;
} }
@ApiOperation("获取指定类型的料仓列表")
@GetMapping(value = "/listByType")
public List<StorageDto> listByType(String type) {
Criteria c = Criteria.where("type").is(type);
List<Storage> storages = storageManager.findByQuery(new Query(c));
List<StorageDto> storageDtos = storageMapper.toDto(storages);
storageDtos = updateDtos(storageDtos);
return storageDtos;
}
@ApiOperation("料架设置界面,返回所有的料架列表") @ApiOperation("料架设置界面,返回所有的料架列表")
@GetMapping(value = "/allShelf") @GetMapping(value = "/allShelf")
public List<StorageDto> allShelf() { public List<StorageDto> allShelf() {
......
...@@ -54,8 +54,10 @@ public class CodeLightController { ...@@ -54,8 +54,10 @@ public class CodeLightController {
@GetMapping(value = "/reelList") @GetMapping(value = "/reelList")
@ResponseBody @ResponseBody
@AnonymousAccess @AnonymousAccess
public List<ShelfDto> reelList(HttpServletRequest servletRequest) { public List<ShelfDto> reelList(String cid) {
if(ObjectUtil.isEmpty(cid)){
cid="";
}
List<ShelfDto> shelfDtos = new ArrayList<>(); List<ShelfDto> shelfDtos = new ArrayList<>();
Map<String, String> lineShelfLocMap = TaskShelfUtil.lineShelfLocMap; Map<String, String> lineShelfLocMap = TaskShelfUtil.lineShelfLocMap;
for (String rfid : for (String rfid :
...@@ -64,6 +66,10 @@ public class CodeLightController { ...@@ -64,6 +66,10 @@ public class CodeLightController {
ShelfDto dto = new ShelfDto(); ShelfDto dto = new ShelfDto();
dto.setRfid(rfid); dto.setRfid(rfid);
dto.setLoc(shelfLoc); dto.setLoc(shelfLoc);
String currCid=TaskShelfUtil.getCid(shelfLoc);
if(ObjectUtil.isNotEmpty(cid)&&(!cid.equals(currCid))){
continue;
}
ShelfInfo shelfInfo = TaskShelfUtil.findShelfByRealRfid(rfid); ShelfInfo shelfInfo = TaskShelfUtil.findShelfByRealRfid(rfid);
if (shelfInfo != null) { if (shelfInfo != null) {
...@@ -111,7 +117,7 @@ public class CodeLightController { ...@@ -111,7 +117,7 @@ public class CodeLightController {
dto.setLoc("line"+i); dto.setLoc("line"+i);
List<ShelfReelDto> reelDtos = new ArrayList<>(); List<ShelfReelDto> reelDtos = new ArrayList<>();
for (int j=1;j<=10;j++){ for (int j=1;j<=10;j++){
ShelfReelDto reelDto=new ShelfReelDto("PN"+j,"BARCODE"+j,"PosName"+j); ShelfReelDto reelDto=new ShelfReelDto("PN"+j,"BARCODE"+j,cid+"-PosName"+j);
reelDtos.add(reelDto); reelDtos.add(reelDto);
} }
dto.setReelList(reelDtos); dto.setReelList(reelDtos);
...@@ -220,15 +226,22 @@ public class CodeLightController { ...@@ -220,15 +226,22 @@ public class CodeLightController {
return ResultBean.newErrorResult(99, "smfcore.light.error.noStorage", "未找到料架[" + cid + "]", new String[]{cid}); return ResultBean.newErrorResult(99, "smfcore.light.error.noStorage", "未找到料架[" + cid + "]", new String[]{cid});
} }
StoragePos pos = storagePosManager.getByPosName(posname); // StoragePos pos = storagePosManager.getByPosName(posname);
if (pos == null) { // if (pos == null) {
log.error("lightOff code["+code+"],shelfLoc["+shelfLoc+"],cid["+cid+"],posName["+posname+"]未找到库位"); // log.error("lightOff code["+code+"],shelfLoc["+shelfLoc+"],cid["+cid+"],posName["+posname+"]未找到库位");
return ResultBean.newErrorResult(99, "smfcore.light.error.noStoragePos", "未找到料架库位[" + posname + "]", new String[]{posname}); // return ResultBean.newErrorResult(99, "smfcore.light.error.noStoragePos", "未找到料架库位[" + posname + "]", new String[]{posname});
} // }
//找到对应的库位,给亮灯料架发送灭灯指令 //找到对应的库位,给亮灯料架发送灭灯指令
DevicesStatusUtil.appendOp(storage.getCid(), "close", posname+"="); DevicesStatusUtil.appendOp(storage.getCid(), "close", posname+"=");
log.error("lightOff code["+code+"],shelfLoc["+shelfLoc+"],cid["+cid+"],posName["+posname+"] 库位灭灯:close: "+posname+"=");
//如果料架可离开,发所有库位灭灯
if(shelfInfo.getShelfState()==3){
TaskShelfUtil.CloseShelfLed(shelfInfo);
}
return ResultBean.newOkResult(loc); return ResultBean.newOkResult(loc);
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!