Commit 51973a92 LN

ml5o 对接

1 个父辈 2abff201
...@@ -1058,9 +1058,7 @@ public class RobotBoxHandler extends BaseDeviceHandler { ...@@ -1058,9 +1058,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
String input = request.getParameter("input"); String input = request.getParameter("input");
String output = request.getParameter("output"); String output = request.getParameter("output");
String gantry = request.getParameter("gantry"); String gantry = request.getParameter("gantry");
opTask.updateAppendData("input",input); opTask.setPutData( input,output,gantry);
opTask.updateAppendData("output",output);
opTask.updateAppendData("gantry",gantry);
loadingUtil.updateReelLoc(opTask.getBarcode(),opTask.getPosName(),input,output,gantry ); loadingUtil.updateReelLoc(opTask.getBarcode(),opTask.getPosName(),input,output,gantry );
} }
taskService.updateQueueTask(opTask); taskService.updateQueueTask(opTask);
...@@ -1071,7 +1069,17 @@ public class RobotBoxHandler extends BaseDeviceHandler { ...@@ -1071,7 +1069,17 @@ public class RobotBoxHandler extends BaseDeviceHandler {
taskService.updateFinishedTask(opTask); taskService.updateFinishedTask(opTask);
} }
try{ try{
if (opTask.isInRobot() || opTask.isInLine() || opTask.isBoxdoor()) { if (opTask.isInRobot() || opTask.isInLine() || opTask.isBoxdoor()||opTask.isInShelf()) {
if(opTask.isInShelf()){
String output = request.getParameter("output");
String gantry = request.getParameter("gantry");
String input = request.getParameter("input");
if(ObjectUtil.isNotEmpty(gantry)) {
opTask.setPutData( input,output,gantry);
}
}
//保存状态 //保存状态
MaterialLog m = new MaterialLog(opTask.getBarcode(), opTask.getPosName(), opTask.getType(), opTask.getStatus(), opTask.getLocInfo()); MaterialLog m = new MaterialLog(opTask.getBarcode(), opTask.getPosName(), opTask.getType(), opTask.getStatus(), opTask.getLocInfo());
log.info("记录料盘[" + inouType + "]日志[" + m.getBarcode() + "," + m.getPosName() + "," + m.getStatus() + "," + m.getLocInfo() + "]"); log.info("记录料盘[" + inouType + "]日志[" + m.getBarcode() + "," + m.getPosName() + "," + m.getStatus() + "," + m.getLocInfo() + "]");
......
...@@ -8,13 +8,16 @@ import com.neotel.smfcore.core.device.bean.StatusBean; ...@@ -8,13 +8,16 @@ import com.neotel.smfcore.core.device.bean.StatusBean;
import com.neotel.smfcore.core.device.enums.BOX_STATUS; import com.neotel.smfcore.core.device.enums.BOX_STATUS;
import com.neotel.smfcore.core.device.enums.OP; import com.neotel.smfcore.core.device.enums.OP;
import com.neotel.smfcore.core.device.enums.OP_STATUS; import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.message.util.DeviceMessageUtil;
import com.neotel.smfcore.core.storage.enums.DeviceType; import com.neotel.smfcore.core.storage.enums.DeviceType;
import com.neotel.smfcore.core.storage.service.po.Storage; import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.core.system.service.po.DataLog; import com.neotel.smfcore.core.system.service.po.DataLog;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -74,7 +77,32 @@ public class XLRBoxHandler extends BaseDeviceHandler { ...@@ -74,7 +77,32 @@ public class XLRBoxHandler extends BaseDeviceHandler {
} else if (BOX_STATUS.OUT_END == status) {//出库完成(放到仓门口 } else if (BOX_STATUS.OUT_END == status) {//出库完成(放到仓门口
log.info(statusBean.getCid() +"将物料从库位["+posName+"]出库到门口/料串完成"); log.info(statusBean.getCid() +"将物料从库位["+posName+"]出库到门口/料串完成");
EnLog.info(statusBean.getCid() + " move material from pos [" + posName + "] to door/reel completed"); EnLog.info(statusBean.getCid() + " move material from pos [" + posName + "] to door/reel completed");
reelOnShelf(statusBean.getCid(),posName); // reelOnShelf(statusBean.getCid(),posName);
reelInLine(statusBean.getCid(),posName);
} } else if (BOX_STATUS.OUT_FAILED == status) {
//更改出库状态为OUT_DOOR
List<DataLog> finishedTasks = taskService.getFinishedTasks();
for (DataLog finishedTask : finishedTasks) {
if (finishedTask.getCid().equals(statusBean.getCid()) && finishedTask.isCheckOutTask() && finishedTask.isOutBox()) {
if (posName.equals(finishedTask.getPosName())) {
//已出仓但未放到门口,更改状态
finishedTask.setStatus(OP_STATUS.BOXDOOR_NOREEL.name());
log.info("物料" + finishedTask.getBarcode() + "已从库位" + finishedTask.getPosName() + "取出放到门口,但未感应到料盘,屏蔽库位");
EnLog.info("Material " + finishedTask.getBarcode() + " taken from pos " + finishedTask.getPosName() + " to door, but reel not detected, disable position");
StoragePos pos = storagePosManager.getByPosName(finishedTask.getPosName());
if (pos != null) {
pos.setEnabled(false);
storagePosManager.save(pos);
DeviceMessageUtil.addEnabledPosMessage(pos, "SYSTEM");
Storage storage = dataCache.getStorageById(pos.getStorageId());
if (storage != null) {
dataCache.reloadStorage(storage, storage.getCid());
}
}
taskService.updateFinishedTask(finishedTask);
return statusBean;
}
}
} }
} }
} catch (ValidateException e) { } catch (ValidateException e) {
...@@ -86,6 +114,24 @@ public class XLRBoxHandler extends BaseDeviceHandler { ...@@ -86,6 +114,24 @@ public class XLRBoxHandler extends BaseDeviceHandler {
return statusBean; return statusBean;
} }
protected void reelInLine(String cid,String posName){
//更改出库状态为OUT_DOOR
List<DataLog> finishedTasks = taskService.getFinishedTasks();
for (DataLog finishedTask : finishedTasks) {
if (finishedTask.getCid().equals(cid) && finishedTask.isCheckOutTask() && finishedTask.isOutBox()) {
if (posName.equals(finishedTask.getPosName())) {
//已出仓但未放到门口,更改状态
finishedTask.setStatus(OP_STATUS.INLINE.name());
taskService.updateFinishedTask(finishedTask);
log.info("物料" + finishedTask.getBarcode() + "已从库位" + finishedTask.getPosName() + "取出放到门口,更改状态=INLINE");
EnLog.info("Material " + finishedTask.getBarcode() + " taken from pos " + finishedTask.getPosName() + " to door");
return ;
}
}
}
log.error(posName + "出库放到门口时,未找到对应的出库任务");
EnLog.error("No matching checkout task found when placing pos " + posName + " to door");
}
protected void reelOnShelf(String cid, String posName){ protected void reelOnShelf(String cid, String posName){
DataLog task = taskService.findFinishedOutTask(cid,posName); DataLog task = taskService.findFinishedOutTask(cid,posName);
if(task != null){ if(task != null){
......
package com.neotel.smfcore.core.system.service.po; package com.neotel.smfcore.core.system.service.po;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
...@@ -505,4 +506,21 @@ public class DataLog extends BasePo implements Serializable ,Comparable<DataLog> ...@@ -505,4 +506,21 @@ public class DataLog extends BasePo implements Serializable ,Comparable<DataLog>
} }
return null; return null;
} }
public String getInput(){return getAppendData("input");}
public String getOutput(){return getAppendData("output");}
public String getGantry(){return getAppendData("gantry");}
public void setPutData(String input,String output,String gantry) {
if (ObjectUtil.isNotEmpty(input)) {
updateAppendData("input", input);
}
if (ObjectUtil.isNotEmpty(output)) {
updateAppendData("output", output);
}
if (ObjectUtil.isNotEmpty(gantry)) {
updateAppendData("gantry", gantry);
}
}
} }
...@@ -59,4 +59,9 @@ public class SPutInfo implements Serializable { ...@@ -59,4 +59,9 @@ public class SPutInfo implements Serializable {
//料串操作状态:0=无,1=等待将料串从小车推入滚筒线。2=等待将料串从滚筒线放行到小车 //料串操作状态:0=无,1=等待将料串从小车推入滚筒线。2=等待将料串从滚筒线放行到小车
public int shelfOperateS = 0; public int shelfOperateS = 0;
/**
* 料串放料百分比(0-100)
*/
private int reelPercent=0;
} }
...@@ -9,7 +9,7 @@ import java.io.Serializable; ...@@ -9,7 +9,7 @@ import java.io.Serializable;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
public class InReelDto implements Serializable { public class InOutReelDto implements Serializable {
@ApiModelProperty("物料编号") @ApiModelProperty("物料编号")
private String PN; private String PN;
......
...@@ -2,11 +2,16 @@ package com.neotel.smfcore.custom.micron1551.controller; ...@@ -2,11 +2,16 @@ package com.neotel.smfcore.custom.micron1551.controller;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.core.equipment.bean.EquipStatusBean; import com.neotel.smfcore.core.equipment.bean.EquipStatusBean;
import com.neotel.smfcore.core.equipment.enums.EquipmentType; import com.neotel.smfcore.core.equipment.enums.EquipmentType;
import com.neotel.smfcore.core.equipment.service.po.Equipment; import com.neotel.smfcore.core.equipment.service.po.Equipment;
import com.neotel.smfcore.core.equipment.util.EquipmentCache; import com.neotel.smfcore.core.equipment.util.EquipmentCache;
import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.EquipStatusUtil; import com.neotel.smfcore.core.system.util.EquipStatusUtil;
import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.micron1053.api.MicronApi;
import com.neotel.smfcore.custom.micron1551.bean.dto.InOutReelDto;
import com.neotel.smfcore.custom.micron1551.bean.dto.ML5OViewDto; import com.neotel.smfcore.custom.micron1551.bean.dto.ML5OViewDto;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -18,6 +23,10 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -18,6 +23,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Slf4j @Slf4j
@RestController @RestController
...@@ -26,7 +35,8 @@ import javax.servlet.http.HttpServletRequest; ...@@ -26,7 +35,8 @@ import javax.servlet.http.HttpServletRequest;
public class ML5ODeviceController { public class ML5ODeviceController {
@Autowired @Autowired
private EquipmentCache equipmentCache; private EquipmentCache equipmentCache;
@Autowired
private TaskService taskService;
@ApiOperation("获取ML5O信息") @ApiOperation("获取ML5O信息")
@GetMapping("ml5oView") @GetMapping("ml5oView")
...@@ -65,4 +75,78 @@ public class ML5ODeviceController { ...@@ -65,4 +75,78 @@ public class ML5ODeviceController {
return dto; return dto;
} }
@ApiOperation("获取出库页面物料列表信息")
@GetMapping("outReelList")
@PreAuthorize("@el.check('equipmentView:info')")
public List<InOutReelDto> outReelList(HttpServletRequest servletRequest){
List<InOutReelDto> dtoList=new ArrayList<>();
List<DataLog> tasklist=GetTaskList();
for (DataLog dt :
tasklist) {
InOutReelDto dto=new InOutReelDto(dt.getPartNumber(),dt.getBarcode(),dt.getStatus(),"",dt.getInput(),dt.getOutput(),dt.getGantry());
dtoList.add(dto);
}
if(dtoList.size()<=0&& MicronApi.Debug) {
dtoList.add(new InOutReelDto("PN1", "RI1", "Wait", "MBR", "LP1", "UP1", "G1"));
dtoList.add(new InOutReelDto("PN2", "RI2", "Wait", "MBR", "LP2", "UP3", "G1"));
dtoList.add(new InOutReelDto("PN3", "RI3", "Wait", "MBR", "LP1", "UP1", "G2"));
dtoList.add(new InOutReelDto("PN4", "RI4", "Wait", "MBR", "LP2", "UP3", "G1"));
dtoList.add(new InOutReelDto("PN5", "RI5", "Wait", "MBR", "LP1", "UP1", "G1"));
}
return dtoList;
}
private List<DataLog> GetTaskList() {
int type = 2;
String storageId = "";
List<DataLog> allTasks = taskService.getAllTasks();
List<DataLog> dtos = new ArrayList<>();
for (DataLog datalog : allTasks) {
//判断类型
if (type > 0 && (datalog.getType() != type)) {
continue;
}
//料仓ID
if (ObjectUtil.isNotEmpty(storageId) && !(storageId.equals(datalog.getStorageId()))) {
continue;
}
boolean blurryOk = false;
// 如果是多字段
String blurry = "";
if (ObjectUtil.isNotEmpty(blurry)) {
String[] blurrys = blurry.split(",");
String[] valueArray = new String[]{datalog.getPosName(), datalog.getStorageName(), datalog.getCid(), datalog.getPartNumber(), datalog.getBarcode(), datalog.getSourceName()};
for (String s : blurrys) {
if (ObjectUtil.isNotEmpty(s)) {
for (String v : valueArray) {
try {
Pattern pattern = Pattern.compile(QueryHelp.escapeExprSpecialWord(s), Pattern.CASE_INSENSITIVE);
Matcher m = pattern.matcher(v);
while (m.find()) {
blurryOk = true;
break;
}
if (blurryOk) break;
} catch (Exception ex) {
log.error(ex.toString());
}
}
if (blurryOk) break;
} else {
blurryOk = true;
}
}
} else {
blurryOk = true;
}
if (blurryOk) {
dtos.add(datalog);
}
}
return dtos;
}
} }
...@@ -12,7 +12,7 @@ import com.neotel.smfcore.core.inList.service.po.InListItem; ...@@ -12,7 +12,7 @@ import com.neotel.smfcore.core.inList.service.po.InListItem;
import com.neotel.smfcore.core.system.util.EquipStatusUtil; import com.neotel.smfcore.core.system.util.EquipStatusUtil;
import com.neotel.smfcore.custom.micron1053.api.MicronApi; import com.neotel.smfcore.custom.micron1053.api.MicronApi;
import com.neotel.smfcore.custom.micron1053.loading.util.LoadingUtil; import com.neotel.smfcore.custom.micron1053.loading.util.LoadingUtil;
import com.neotel.smfcore.custom.micron1551.bean.dto.InReelDto; import com.neotel.smfcore.custom.micron1551.bean.dto.InOutReelDto;
import com.neotel.smfcore.custom.micron1551.bean.dto.ML5SViewDto; import com.neotel.smfcore.custom.micron1551.bean.dto.ML5SViewDto;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -97,8 +97,8 @@ public class ML5SDeviceController { ...@@ -97,8 +97,8 @@ public class ML5SDeviceController {
@ApiOperation("获取INPUT页面物料列表信息") @ApiOperation("获取INPUT页面物料列表信息")
@GetMapping("inReelList") @GetMapping("inReelList")
@PreAuthorize("@el.check('equipmentView:info')") @PreAuthorize("@el.check('equipmentView:info')")
public List<InReelDto> inReelList(HttpServletRequest servletRequest){ public List<InOutReelDto> inReelList(HttpServletRequest servletRequest){
List<InReelDto> dtoList=new ArrayList<>(); List<InOutReelDto> dtoList=new ArrayList<>();
InList inList=loadingUtil.getInlist(); InList inList=loadingUtil.getInlist();
if(inList==null){ if(inList==null){
//返回普通入库信息 //返回普通入库信息
...@@ -106,7 +106,7 @@ public class ML5SDeviceController { ...@@ -106,7 +106,7 @@ public class ML5SDeviceController {
for (InListItem item : for (InListItem item :
inList.getInListItems()) { inList.getInListItems()) {
InReelDto dto=new InReelDto(); InOutReelDto dto=new InOutReelDto();
dto.setRi(item.getRi()); dto.setRi(item.getRi());
dto.setPN(item.getPN()); dto.setPN(item.getPN());
dto.setMode(inList.getMode()); dto.setMode(inList.getMode());
...@@ -117,11 +117,11 @@ public class ML5SDeviceController { ...@@ -117,11 +117,11 @@ public class ML5SDeviceController {
} }
} }
if(dtoList.size()<=0&& MicronApi.Debug) { if(dtoList.size()<=0&& MicronApi.Debug) {
dtoList.add(new InReelDto("PN1", "RI1", "Wait", "MBR", "LP1", "UP1", "G1")); dtoList.add(new InOutReelDto("PN1", "RI1", "Wait", "MBR", "LP1", "UP1", "G1"));
dtoList.add(new InReelDto("PN2", "RI2", "Wait", "MBR", "LP2", "UP3", "G1")); dtoList.add(new InOutReelDto("PN2", "RI2", "Wait", "MBR", "LP2", "UP3", "G1"));
dtoList.add(new InReelDto("PN3", "RI3", "Wait", "MBR", "LP1", "UP1", "G2")); dtoList.add(new InOutReelDto("PN3", "RI3", "Wait", "MBR", "LP1", "UP1", "G2"));
dtoList.add(new InReelDto("PN4", "RI4", "Wait", "MBR", "LP2", "UP3", "G1")); dtoList.add(new InOutReelDto("PN4", "RI4", "Wait", "MBR", "LP2", "UP3", "G1"));
dtoList.add(new InReelDto("PN5", "RI5", "Wait", "MBR", "LP1", "UP1", "G1")); dtoList.add(new InOutReelDto("PN5", "RI5", "Wait", "MBR", "LP1", "UP1", "G1"));
} }
return dtoList; return dtoList;
} }
......
...@@ -31,7 +31,7 @@ public class Micron1551Menu { ...@@ -31,7 +31,7 @@ public class Micron1551Menu {
MenuInit.addMenu(menuLabel,mL5,120, "ML5S Input","ml5sInput", "ml5s/input/index","dispatch"); MenuInit.addMenu(menuLabel,mL5,120, "ML5S Input","ml5sInput", "ml5s/input/index","dispatch");
MenuInit.addMenu(menuLabel,mL5,121, "ML5S Ouput","ml5sOutput", "ml5s/output/index","dispatch"); MenuInit.addMenu(menuLabel,mL5,121, "ML5S Ouput","ml5sOutput", "ml5s/output/index","dispatch");
MenuInit.addMenu(menuLabel,mL5,122, "X800","X800", "x800kanban/index","X800"); MenuInit.addMenu(menuLabel,mL5,122, "X800","X800", "x800kanban/index","X800");
MenuInit.addMenu(menuLabel,mL5, 131, "ML5O STATUS", "ML5DispatchSelect", "mlFive/dispatchSelect/index","dispatchSelection"); MenuInit.addMenu(menuLabel,mL5, 131, "ML5O STATUS", "ml5odispatch", "ml5s/ml5odispatch/index","dispatchSelection");
// MenuInit.addMenu(menuLabel,mL5,132, "ML5S STORAGE","ML5Loading", "mlFive/LoadingSelect/index","loadingSelection"); // MenuInit.addMenu(menuLabel,mL5,132, "ML5S STORAGE","ML5Loading", "mlFive/LoadingSelect/index","loadingSelection");
// MenuInit.addMenu(menuLabel,mL5,133, "DISPATCH STATUS", "dispatchStatus", "mlFive/dispatchStatus/index","dispatchStatus"); // MenuInit.addMenu(menuLabel,mL5,133, "DISPATCH STATUS", "dispatchStatus", "mlFive/dispatchStatus/index","dispatchStatus");
// MenuInit.addMenu(menuLabel,mL5,134,"LOADING STATUS","loadingStatus", "mlFive/loadingStatus/index","loadingStatus"); // MenuInit.addMenu(menuLabel,mL5,134,"LOADING STATUS","loadingStatus", "mlFive/loadingStatus/index","loadingStatus");
...@@ -43,7 +43,7 @@ public class Micron1551Menu { ...@@ -43,7 +43,7 @@ public class Micron1551Menu {
// MenuInit.addMenu(menuLabel,status,142, "Temperature Log","tempLog", "status/tempLog/index","temput"); // MenuInit.addMenu(menuLabel,status,142, "Temperature Log","tempLog", "status/tempLog/index","temput");
// MenuInit.addMenu(menuLabel,status,143, "Humidity Log","humidityLog", "status/humidityLog/index","hum"); // MenuInit.addMenu(menuLabel,status,143, "Humidity Log","humidityLog", "status/humidityLog/index","hum");
// //s
// MenuInit.addMenu(menuLabel,null,150, "SBSH1","SBSH1", "SBSH/sbshOne/index","sbsh"); // MenuInit.addMenu(menuLabel,null,150, "SBSH1","SBSH1", "SBSH/sbshOne/index","sbsh");
// MenuInit.addMenu(menuLabel,null,151, "SBSH2","SBSH2", "SBSH/sbshOne/index","sbsh"); // MenuInit.addMenu(menuLabel,null,151, "SBSH2","SBSH2", "SBSH/sbshOne/index","sbsh");
// MenuInit.addMenu(menuLabel,null,152, "SBDH1","SBDH1", "SBSH/sbshOne/index","sbdh"); // MenuInit.addMenu(menuLabel,null,152, "SBDH1","SBDH1", "SBSH/sbshOne/index","sbdh");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!