Commit 2abff201 LN

x800从菜单进入

1 个父辈 2ef4cf7e
package com.neotel.smfcore.core.equipment.rest; package com.neotel.smfcore.core.equipment.rest;
import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.core.device.util.DataCache; import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.equipment.enums.EquipmentType; import com.neotel.smfcore.core.equipment.enums.EquipmentType;
...@@ -281,8 +282,16 @@ public class EquipViewController { ...@@ -281,8 +282,16 @@ public class EquipViewController {
@GetMapping("xCounterView") @GetMapping("xCounterView")
@PreAuthorize("@el.check('equipmentView:info')") @PreAuthorize("@el.check('equipmentView:info')")
public XCounterViewDto xCounterView(String cid, HttpServletRequest servletRequest){ public XCounterViewDto xCounterView(String cid, HttpServletRequest servletRequest){
Equipment equip = equipmentCache.getEquipment(cid); Equipment equip=null;
if (equip == null ||(!equip.isNEOCOUNTER())) { if(ObjectUtil.isEmpty(cid)) {
equip = equipmentCache.findEquipByType(EquipmentType.NEOCOUNTER.name());
if (equip != null) {
cid = equip.getCid();
}
}
else {
equip= equipmentCache.getEquipment(cid);
}if (equip == null ||(!equip.isNEOCOUNTER())) {
throw new ValidateException("smfcore.equip.notExist","设备不存在"); throw new ValidateException("smfcore.equip.notExist","设备不存在");
} }
XCounterViewDto dto=new XCounterViewDto(); XCounterViewDto dto=new XCounterViewDto();
......
...@@ -97,14 +97,14 @@ public class ML5DeviceController { ...@@ -97,14 +97,14 @@ public class ML5DeviceController {
} }
String lastPosId = ""; String lastPosId = "";
String lineMsg = ""; String lineMsg = "";
log.info("ml5s[" + cids + "]获取[" + code + "],rfid=["+rfid+"]的入库库位"); log.info("ml5sEmptyPosForPutin[" + cids + "]获取[" + code + "],rfid=["+rfid+"]的入库库位");
EnLog.info("Line [" + cids + "] get put-in position for [" + code + "], rfid=[" + rfid + "]"); EnLog.info("Line [" + cids + "] get put-in position for [" + code + "], rfid=[" + rfid + "]");
return ml5sPosForPutin(code,cids,"",rfid,request.getLocale()); return ml5sPosForPutin(code,cids,"",rfid,request.getLocale());
} }
public Map<String, Object> ml5sPosForPutin(String code, String cids, String preCid, String rfid, Locale locale){ public Map<String, Object> ml5sPosForPutin(String code, String cids, String preCid, String rfid, Locale locale){
log.info("posForPutin,code=["+code+"],cids=["+cids+"],preCid=["+preCid+"]"); log.info("ml5sPosForPutin,code=["+code+"],cids=["+cids+"],preCid=["+preCid+"]");
EnLog.info("posForPutin, code=[" + code + "], cids=[" + cids + "], preCid=[" + preCid + "]"); EnLog.info("posForPutin, code=[" + code + "], cids=[" + cids + "], preCid=[" + preCid + "]");
String lastPosId = ""; String lastPosId = "";
String lineMsg = ""; String lineMsg = "";
...@@ -132,11 +132,15 @@ public class ML5DeviceController { ...@@ -132,11 +132,15 @@ public class ML5DeviceController {
List<Storage> storageList = Lists.newArrayList(); List<Storage> storageList = Lists.newArrayList();
//急停,报警,调试状态的料仓不可用 //急停,报警,调试状态的料仓不可用
List<String> cidList = dataCache.getAvailableStorageIds(DeviceType.SMD_DUO); List<String> cidList = dataCache.getAvailableStorageIds(DeviceType.SMD_DUO);
List<String> thirdList=dataCache.getAvailableStorageIds(DeviceType.SMDBOX_THIRD);
cidList.addAll(thirdList); if(cidArray.length==0){
// for (String cid : cidList) { cidArray = cidList.toArray(new String[0]);
for(String cid:cidArray) { }
if (cidList.contains(cid)) { // List<String> thirdList=dataCache.getAvailableStorageIds(DeviceType.SMDBOX_THIRD);
// cidList.addAll(thirdList);
for (String cid : cidArray) {
// for(String cid:cidList) {
// if (cidList.contains(cid)) {
String notIntoCids = dataCache.getSettings().getNotIntoCids(); String notIntoCids = dataCache.getSettings().getNotIntoCids();
if (notIntoCids != null) { if (notIntoCids != null) {
if (notIntoCids.contains(cid)) { if (notIntoCids.contains(cid)) {
...@@ -157,7 +161,7 @@ public class ML5DeviceController { ...@@ -157,7 +161,7 @@ public class ML5DeviceController {
if (storage != null ) { if (storage != null ) {
storageList.add(storage); storageList.add(storage);
} }
} // }
} }
if (storageList.isEmpty()) { if (storageList.isEmpty()) {
//无可用的料仓 //无可用的料仓
...@@ -366,38 +370,38 @@ public class ML5DeviceController { ...@@ -366,38 +370,38 @@ public class ML5DeviceController {
} }
} }
// 13*44,13*56,13*72这三个料入到我们的料仓,其他的13寸,15寸都入迈康尼的料仓 //// 13*44,13*56,13*72这三个料入到我们的料仓,其他的13寸,15寸都入迈康尼的料仓
int inStorageType=0;//0=所有料仓都可以,1=只能入我们料仓。2=只能入麦康尼料仓 // int inStorageType=0;//0=所有料仓都可以,1=只能入我们料仓。2=只能入麦康尼料仓
if(barcode.getPlateSize()==13){ // if(barcode.getPlateSize()==13){
if(barcode.getHeight()==44||barcode.getHeight()==56||barcode.getHeight()==72){ // if(barcode.getHeight()==44||barcode.getHeight()==56||barcode.getHeight()==72){
//只能入robot // //只能入robot
inStorageType=1; // inStorageType=1;
}else { // }else {
inStorageType=2; // inStorageType=2;
} // }
}else if(barcode.getPlateSize()==15){ // }else if(barcode.getPlateSize()==15){
inStorageType=2; // inStorageType=2;
} // }
List<Storage> storages=new ArrayList<>(); // List<Storage> storages=new ArrayList<>();
for (Storage storage :storageList) { // for (Storage storage :storageList) {
if(inStorageType==1){ // if(inStorageType==1){
if( storage.isRobotBox()) { // if( storage.isRobotBox()) {
storages.add(storage); // storages.add(storage);
} // }
}else if(inStorageType==2){ // }else if(inStorageType==2){
if(storage.isTHIRDBox()) { // if(storage.isTHIRDBox()) {
//麦康尼料仓需要判断 当前剩余空库位是否可以放下料盘 // //麦康尼料仓需要判断 当前剩余空库位是否可以放下料盘
if (dataCache.thirdBoxCanPutIn(storage, barcode.getPlateSize(), barcode.getHeight(),taskService.getQueueTasks(storage.getCid()))) { // if (dataCache.thirdBoxCanPutIn(storage, barcode.getPlateSize(), barcode.getHeight(),taskService.getQueueTasks(storage.getCid()))) {
storages.add(storage); // storages.add(storage);
} // }
} // }
}else { // }else {
storages.add(storage); // storages.add(storage);
} // }
} // }
//先验证下是否有空位,如果无空位直接返回,不需要调用API //先验证下是否有空位,如果无空位直接返回,不需要调用API
StoragePos testFindPos = taskService.findEmptyPosForPutIn(storages, barcode, "", lastPosId); StoragePos testFindPos = taskService.findEmptyPosForPutIn(storageList, barcode, "", lastPosId);
if(testFindPos==null) { if(testFindPos==null) {
resultMap.put("result", "104"); resultMap.put("result", "104");
String size = getBarcodeSize(barcode); String size = getBarcodeSize(barcode);
...@@ -427,7 +431,7 @@ public class ML5DeviceController { ...@@ -427,7 +431,7 @@ public class ML5DeviceController {
else{ else{
StoragePos pos = taskService.findEmptyPosForPutIn(storages, barcode, "", lastPosId); StoragePos pos = taskService.findEmptyPosForPutIn(storageList, barcode, "", lastPosId);
if (pos != null) { if (pos != null) {
Storage storage = dataCache.getStorageById(pos.getStorageId()); Storage storage = dataCache.getStorageById(pos.getStorageId());
......
...@@ -35,11 +35,14 @@ public class ML5ODeviceController { ...@@ -35,11 +35,14 @@ public class ML5ODeviceController {
Equipment equip =null; Equipment equip =null;
if(ObjectUtil.isEmpty(cid)){ if(ObjectUtil.isEmpty(cid)){
equip=equipmentCache.findEquipByType(EquipmentType.ML5O.name()); equip=equipmentCache.findEquipByType(EquipmentType.ML5O.name());
if(equip!=null){
cid=equip.getCid();
}
} }
else { else {
equip = equipmentCache.getEquipment(cid); equip = equipmentCache.getEquipment(cid);
} }
if (equip == null ||(!equip.isML5S())) { if (equip == null ||(!equip.isML5O())) {
throw new ValidateException("smfcore.equip.notExist","设备不存在"); throw new ValidateException("smfcore.equip.notExist","设备不存在");
} }
ML5OViewDto dto=new ML5OViewDto(); ML5OViewDto dto=new ML5OViewDto();
......
...@@ -45,6 +45,9 @@ public class ML5SDeviceController { ...@@ -45,6 +45,9 @@ public class ML5SDeviceController {
Equipment equip =null; Equipment equip =null;
if(ObjectUtil.isEmpty(cid)){ if(ObjectUtil.isEmpty(cid)){
equip=equipmentCache.findEquipByType(EquipmentType.ML5S.name()); equip=equipmentCache.findEquipByType(EquipmentType.ML5S.name());
if(equip!=null){
cid=equip.getCid();
}
} }
else { else {
equip = equipmentCache.getEquipment(cid); equip = equipmentCache.getEquipment(cid);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!