Commit 59765f11 zshaohui
2 个父辈 6ae91781 c4a633b0
package com.neotel.smfcore.core.device.bean;
import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.core.device.enums.BOX_STATUS;
import java.util.HashMap;
......@@ -148,6 +149,30 @@ public class BoxStatusBean {
return data.get("barcode");
}
public Map<String,Integer> getCapacity() {
String capacity = data.get("capacity");
Map<String, Integer> caMap = new HashMap<>();
try {
if (ObjectUtil.isNotEmpty(capacity)) {
String[] arr = capacity.split(";");
for (String ar :
arr) {
if (ObjectUtil.isNotEmpty(ar)) {
String[] ar2 = ar.split("=");
if (ar2.length == 2) {
caMap.put(ar2[0], Integer.valueOf(ar2[1]));
}
}
}
}
} catch (Exception ex) {
}
return caMap;
// boxStatus.data.Add("capacity", "7X8=1000;7X12=345;13X32=100;");
}
/**
* 从data中获取值
*/
......
......@@ -228,9 +228,9 @@ public class RobotBoxHandler extends BaseDeviceHandler {
String code = request.getParameter("code");
String cids = request.getParameter("cids");
String lastPosId = "";
String lineMsg = "";
log.info("流水线[" + cids + "]获取[" + code + "]的入库库位");
String[] cidArray= cids.split(",");
Map<String, Object> resultMap = Maps.newHashMap();
String okMsg = "";
String errorMsg = "";
......@@ -238,19 +238,22 @@ public class RobotBoxHandler extends BaseDeviceHandler {
List<String> cidList = dataCache.getAvailableStorageIds(this.getDeviceType());
List<String> thirdList=dataCache.getAvailableStorageIds(DeviceType.SMDBOX_THIRD);
cidList.addAll(thirdList);
for (String cid : cidList) {
String notIntoCids = dataCache.getSettings().getNotIntoCids();
if (notIntoCids != null) {
if (notIntoCids.contains(cid)) {
log.info("料仓[" + cid + "]已被屏蔽入库");
continue;
// for (String cid : cidList) {
for(String cid:cidArray) {
if (cidList.contains(cid)) {
String notIntoCids = dataCache.getSettings().getNotIntoCids();
if (notIntoCids != null) {
if (notIntoCids.contains(cid)) {
log.info("料仓[" + cid + "]已被屏蔽入库");
continue;
}
}
Storage storage = dataCache.getStorage(cid);
if (storage != null) {
storageList.add(storage);
}
}
}
Storage storage = dataCache.getStorage(cid);
if (storage != null) {
storageList.add(storage);
}
}
if (storageList.isEmpty()) {
resultMap.put("result", "99");
errorMsg = "无可用的料仓";
......@@ -305,7 +308,36 @@ public class RobotBoxHandler extends BaseDeviceHandler {
return resultMap;
}*/
StoragePos pos = taskService.findEmptyPosForPutIn(storageList, barcode, "", lastPosId);
//根据尺寸获取指定的料仓
// 13*44,13*56,13*72这三个料入到我们的料仓,其他的13寸,15寸都入迈康尼的料仓
int inStorageType=0;//0=所有料仓都可以,1=只能入我们料仓。2=只能入麦康尼料仓
if(barcode.getPlateSize()==13){
if(barcode.getHeight()==44||barcode.getHeight()==56||barcode.getHeight()==72){
//只能入robot
inStorageType=1;
}else {
inStorageType=2;
}
}else if(barcode.getPlateSize()==15){
inStorageType=2;
}
List<Storage> storages=new ArrayList<>();
for (Storage storage :storageList) {
if(inStorageType==1){
if( storage.isRobotBox()) {
storages.add(storage);
}
}else if(inStorageType==2){
if(storage.isTHIRDBox()){
storages.add(storage);
}
}else {
storages.add(storage);
}
}
StoragePos pos = taskService.findEmptyPosForPutIn(storages, barcode, "", lastPosId);
if (pos != null) {
Storage storage = dataCache.getStorageById(pos.getStorageId());
......
......@@ -312,4 +312,7 @@ public class Storage extends BasePo implements Serializable {
public boolean isRobotBox() {
return DeviceType.ROBOT_BOX.name().equals(type);
}
public boolean isTHIRDBox() {
return DeviceType.SMDBOX_THIRD.name().equals(type);
}
}
......@@ -33,11 +33,11 @@ public class MicronML5Controller {
@GetMapping("/status")
@AnonymousAccess
public ML5StatusDto ml5Status( ) {
ML5StatusDto dto=new ML5StatusDto();
MicronEquipStatus r1=MicronDataCache.getStatus(MicronEquipName.ML5_R1.getName());
MicronEquipStatus r2=MicronDataCache.getStatus(MicronEquipName.ML5_R2.getName());
MicronEquipStatus l1=MicronDataCache.getStatus(MicronEquipName.ML5_L1.getName());
MicronEquipStatus l2=MicronDataCache.getStatus(MicronEquipName.ML5_L2.getName());
ML5StatusDto dto = new ML5StatusDto();
MicronEquipStatus r1 = MicronDataCache.getStatus(MicronEquipName.ML5_R1.getName());
MicronEquipStatus r2 = MicronDataCache.getStatus(MicronEquipName.ML5_R2.getName());
MicronEquipStatus l1 = MicronDataCache.getStatus(MicronEquipName.ML5_L1.getName());
MicronEquipStatus l2 = MicronDataCache.getStatus(MicronEquipName.ML5_L2.getName());
dto.setL1Status(l1.getStatus());
dto.setL2Status(l2.getStatus());
......@@ -46,27 +46,37 @@ public class MicronML5Controller {
dto.setNg1Count(l1.getNgCount());
dto.setNg2Count(r1.getNgCount());
List<EquipMsg> msgs=new ArrayList<>();
msgs.addAll(r1.getMsgList());
msgs.addAll(r2.getMsgList());
msgs.addAll(l1.getMsgList());
msgs.addAll(l2.getMsgList());
dto.setMsgList(msgs);
List<EquipMsg> msgs = new ArrayList<>();
if (r1.getMsgList() != null && r1.getMsgList().size() > 0) {
msgs.addAll(r1.getMsgList());
}
if (r2.getMsgList() != null && r2.getMsgList().size() > 0) {
msgs.addAll(r2.getMsgList());
}
if (l1.getMsgList() != null && l1.getMsgList().size() > 0) {
msgs.addAll(l1.getMsgList());
}
if (l2.getMsgList() != null && l2.getMsgList().size() > 0) {
msgs.addAll(l2.getMsgList());
}
if (msgs.size() > 0) {
dto.setMsgList(msgs);
}
Map<String,Integer> needShelfs=new HashMap<>();
List<DataLog> dataLogs= taskService.getAllTasks();
for (DataLog task :dataLogs
Map<String, Integer> needShelfs = new HashMap<>();
List<DataLog> dataLogs = taskService.getAllTasks();
for (DataLog task : dataLogs
) {
String taskType=MicronDataCache.GetMaterialType(task);
String shelf=MicronDataCache.getShelfType(taskType);
if(needShelfs.containsKey(shelf)){
int newCount=needShelfs.get(shelf)+1;
needShelfs.put(shelf,newCount);
}else{
needShelfs.put(shelf,1);
String taskType = MicronDataCache.GetMaterialType(task);
String shelf = MicronDataCache.getShelfType(taskType);
if (needShelfs.containsKey(shelf)) {
int newCount = needShelfs.get(shelf) + 1;
needShelfs.put(shelf, newCount);
} else {
needShelfs.put(shelf, 1);
}
}
if(needShelfs.size()>0){
if (needShelfs.size() > 0) {
dto.setNeedShelfs(needShelfs);
}
......
......@@ -94,7 +94,7 @@ public class MicronDataCache {
}else if(materialType.equals(TRAY)){
return "M03";
}
return "";
return "S007";
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!