Commit 48ad9aed LN

1.入料任务放到up后上传出入口信息。

2.增加ml5so
1 个父辈 54eb7048
......@@ -60,6 +60,12 @@ public enum OP_STATUS {
/**
* 已放到料仓门口无料盘
*/
BOXDOOR_NOREEL
BOXDOOR_NOREEL,
/**
* 入库任务,已经放在UP料串上,ML5S机构放到UP料串后更新此状态
*/
INSHELF
;
}
......@@ -1054,6 +1054,15 @@ public class RobotBoxHandler extends BaseDeviceHandler {
if (opTask.isPutInTask()) {
if(opTask.isInShelf()){
String input = request.getParameter("input");
String output = request.getParameter("output");
String gantry = request.getParameter("gantry");
opTask.updateAppendData("input",input);
opTask.updateAppendData("output",output);
opTask.updateAppendData("gantry",gantry);
loadingUtil.updateReelLoc(opTask.getBarcode(),opTask.getPosName(),input,output,gantry );
}
taskService.updateQueueTask(opTask);
} else {
if (opTask.isFinished()) {
......
......@@ -92,6 +92,6 @@ public enum EquipmentType {
}
public static List<String> otherList(){
return Lists.newArrayList(ML5S.name(),ML5O.name());
return Lists.newArrayList(ML5S.name() ,ML5O.name());
}
}
......@@ -46,6 +46,9 @@ public class Equipment extends BasePo implements Serializable {
public boolean isML5S() {
return EquipmentType.ML5S.name().equals(type);
}
public boolean isML5O() {
return EquipmentType.ML5O.name().equals(type);
}
/**
* 是否是接口设备
* @return
......
......@@ -12,7 +12,10 @@ import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.Document;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Data
@Document
@AllArgsConstructor
......@@ -152,5 +155,36 @@ public class InListItem extends BasePo implements Serializable {
inReelCount+=1;
}
/**
* 自定义的附加信息
*/
private Map<String,Object> appendData = new HashMap<>();
/**
* 添加或更新自定义附加信息
* @param appendKey
* @param appendValue
*/
public void updateAppendData(String appendKey, Object appendValue){
if(appendData==null){
appendData=new HashMap<>();
}
appendData.put(appendKey, appendValue);
}
/**
* 获取自定义附加信息
* @param appendKey
* @param <T>
* @return
*/
public <T> T getAppendData(String appendKey) {
if (appendData != null) {
Object value = appendData.get(appendKey);
if (value != null) {
return (T) value;
}
}
return null;
}
}
......@@ -433,6 +433,8 @@ public class LanguageMsgService {
String msg = "";
List<LanguageMsg> list = new ArrayList<>();
while (csvRead.readRecord()) {
try {
row++;
String[] lineValues = csvRead.getValues();
LanguageMsg languageMsg = new LanguageMsg();
......@@ -459,6 +461,9 @@ public class LanguageMsgService {
}
list.add(languageMsg);
} catch (Exception exception) {
log.error("解析资源失败第" + row + "行,");
}
}
return list;
}
......
......@@ -15,7 +15,9 @@ import org.springframework.data.mongodb.core.mapping.Document;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Data
@Document
......@@ -305,6 +307,9 @@ public class DataLog extends BasePo implements Serializable ,Comparable<DataLog>
public boolean isBoxdoor(){
return OP_STATUS.BOXDOOR.name().equals(status) || OP_STATUS.BOXDOOR_NOREEL.equals(status);
}
public boolean isInShelf(){
return OP_STATUS.INSHELF.equals(status);
}
/**
* 是否是入库任务
*/
......@@ -466,4 +471,38 @@ public class DataLog extends BasePo implements Serializable ,Comparable<DataLog>
public int compareTo(DataLog o) {
return this.getId().compareTo(o.getId());
}
/**
* 自定义的附加信息
*/
private Map<String,Object> appendData = new HashMap<>();
/**
* 添加或更新自定义附加信息
* @param appendKey
* @param appendValue
*/
public void updateAppendData(String appendKey, Object appendValue){
if(appendData==null){
appendData=new HashMap<>();
}
appendData.put(appendKey, appendValue);
}
/**
* 获取自定义附加信息
* @param appendKey
* @param <T>
* @return
*/
public <T> T getAppendData(String appendKey) {
if (appendData != null) {
Object value = appendData.get(appendKey);
if (value != null) {
return (T) value;
}
}
return null;
}
}
......@@ -249,6 +249,35 @@ public class LoadingUtil {
EnLog.error("IsInlistReel, barcode=" + barcode + ", error: " + exception.toString(), exception);
}
return false;
} public InListItem updateReelLoc( String barcode,String posName,String input,String output,String gantry) {
InList inList = getInlist();
if (inList == null) {
return null;
}
InListItem result = null;
boolean update = false;
List<InListItem> inListItems = new ArrayList<>();
for (InListItem item :
inList.getInListItems()) {
if (item.getRi().equals(barcode)) {
item.updateAppendData("input",input);
item.updateAppendData("output",output);
item.updateAppendData("gantry",gantry);
update=true;
}
inListItems.add(item);
}
if (update) {
inList.setInListItems(inListItems);
inList = inListManager.save(inList);
inListCache.addInListToMap(inList);
}
return result;
}
public InListItem AddOrUpdateItemState( String rfid, Barcode barcode,String posName,String s,String ngMsg) {
InListItem item = updateItemState(barcode.getBarcode(), posName, s, ngMsg);
......
......@@ -52,4 +52,11 @@ public class SPutInfo implements Serializable {
*/
private int putQty;
/**
* 料串目的地,目标料仓CID,Output用
*/
public String targetP ;
//料串操作状态:0=无,1=等待将料串从小车推入滚筒线。2=等待将料串从滚筒线放行到小车
public int shelfOperateS = 0;
}
package com.neotel.smfcore.custom.micron1551.bean.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class InReelDto implements Serializable {
@ApiModelProperty("物料编号")
private String PN;
@ApiModelProperty("RI")
private String ri;
@ApiModelProperty("状态, 成功=Success,PutIn,PutEnd,Wait, Xray=Xray,XRayEnd, NG=API001NG,NG,Cancel, Failure=Faile,XRayFail")
private String status;
@ApiModelProperty("Mode")
private String mode;
@ApiModelProperty("Input")
private String input;
@ApiModelProperty("output")
private String output;
@ApiModelProperty("gantry")
private String gantry;
}
package com.neotel.smfcore.custom.micron1551.bean.dto;
import com.neotel.smfcore.core.equipment.bean.EquipMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Data
public class ML5OViewDto implements Serializable {
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("CID")
private String cid;
@ApiModelProperty("设备状态,0=离线,1=正常运行中, 2=急停,3=故障,4=警告,5=调试,6=忙碌中")
//1=设备联机 2=急停,3=故障,4=警告,5=调试,6=忙碌中
private int status=0;
@ApiModelProperty("文字显示")
private String msg = "";
@ApiModelProperty("仅显示的日志消息集合")
private List<EquipMsg> showLogs = new ArrayList<>();
/**
* 发上来的数据
*
* ml5s定义:
* key=LP1,value=入口1
* key=LP2,value=入口2
* key=TP1,value=龙门架1
* kty=TP2,value=龙门架2
* key=UP1,value=出口1
* key=UP2,value=出口2
* key=UP3,value=出口3
* key=UP4,value=出口4
*/
private Map<String, Object> data = new HashMap<>();
}
package com.neotel.smfcore.custom.micron1551.controller;
import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.core.equipment.bean.EquipStatusBean;
import com.neotel.smfcore.core.equipment.enums.EquipmentType;
import com.neotel.smfcore.core.equipment.service.po.Equipment;
import com.neotel.smfcore.core.equipment.util.EquipmentCache;
import com.neotel.smfcore.core.system.util.EquipStatusUtil;
import com.neotel.smfcore.custom.micron1551.bean.dto.ML5OViewDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@Slf4j
@RestController
@Api(tags = "1551:ML5O")
@RequestMapping("/rest/micron/ml5o")
public class ML5ODeviceController {
@Autowired
private EquipmentCache equipmentCache;
@ApiOperation("获取ML5O信息")
@GetMapping("ml5oView")
@PreAuthorize("@el.check('equipmentView:info')")
public ML5OViewDto ml5oView(String cid, HttpServletRequest servletRequest){
Equipment equip =null;
if(ObjectUtil.isEmpty(cid)){
equip=equipmentCache.findEquipByType(EquipmentType.ML5O.name());
}
else {
equip = equipmentCache.getEquipment(cid);
}
if (equip == null ||(!equip.isML5S())) {
throw new ValidateException("smfcore.equip.notExist","设备不存在");
}
ML5OViewDto dto=new ML5OViewDto();
dto.setCid(cid);
dto.setName(equip.getName());
EquipStatusBean bean= EquipStatusUtil.getStatusBean(equip.getCid());
if(bean!=null){
if(bean.timeOut()){
dto.setStatus(0);
}else{
dto.setStatus(bean.getStatus());
dto.setMsg(bean.getShowMsg(servletRequest.getLocale()));
dto.setData(bean.getData());
dto.setShowLogs(bean.getShowLogs());
}
}
return dto;
}
}
......@@ -8,8 +8,11 @@ import com.neotel.smfcore.core.equipment.enums.EquipmentType;
import com.neotel.smfcore.core.equipment.service.po.Equipment;
import com.neotel.smfcore.core.equipment.util.EquipmentCache;
import com.neotel.smfcore.core.inList.service.po.InList;
import com.neotel.smfcore.core.inList.service.po.InListItem;
import com.neotel.smfcore.core.system.util.EquipStatusUtil;
import com.neotel.smfcore.custom.micron1053.api.MicronApi;
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.ML5SViewDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -21,6 +24,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@RestController
......@@ -74,4 +79,39 @@ public class ML5SDeviceController {
}
return dto;
}
@ApiOperation("获取INPUT页面物料列表信息")
@GetMapping("inReelList")
@PreAuthorize("@el.check('equipmentView:info')")
public List<InReelDto> inReelList(HttpServletRequest servletRequest){
List<InReelDto> dtoList=new ArrayList<>();
InList inList=loadingUtil.getInlist();
if(inList==null){
//返回普通入库信息
}else {
for (InListItem item :
inList.getInListItems()) {
InReelDto dto=new InReelDto();
dto.setRi(item.getRi());
dto.setPN(item.getPN());
dto.setMode(inList.getMode());
dto.setStatus(item.getState());
dto.setInput(item.getAppendData("input"));
dto.setOutput(item.getAppendData("output"));
dto.setGantry(item.getAppendData("gantry"));
}
}
if(dtoList.size()<=0&& MicronApi.Debug) {
dtoList.add(new InReelDto("PN1", "RI1", "Wait", "MBR", "LP1", "UP1", "G1"));
dtoList.add(new InReelDto("PN2", "RI2", "Wait", "MBR", "LP2", "UP3", "G1"));
dtoList.add(new InReelDto("PN3", "RI3", "Wait", "MBR", "LP1", "UP1", "G2"));
dtoList.add(new InReelDto("PN4", "RI4", "Wait", "MBR", "LP2", "UP3", "G1"));
dtoList.add(new InReelDto("PN5", "RI5", "Wait", "MBR", "LP1", "UP1", "G1"));
}
return dtoList;
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!