Commit fb733c02 zshaohui

1.入料机构,料串获取目的地,13寸料串改成和7寸一样

2.更新任务状态,任务不存在时,创建一个新的任务,改库存状态
3.增加入库分拣机上空闲的料箱接口
1 个父辈 b5853c71
......@@ -5,20 +5,25 @@ import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.utils.ReelLockPosUtil;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import com.neotel.smfcore.core.device.enums.OP;
import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.equipment.bean.EquipStatusBean;
import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
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.manager.IDataLogManager;
import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.EquipStatusUtil;
import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil;
import com.neotel.smfcore.custom.luxsan.api.LuxsanApi;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.CtuTask;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.TaskCurrentLoc;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.config.StorageNameConfig;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BinCacheUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.MaterialUtil;
......@@ -37,6 +42,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.swing.*;
import java.util.*;
import java.util.stream.Collectors;
......@@ -58,6 +64,12 @@ public class CtuDeviceController {
@Autowired
private IStoragePosManager storagePosManager;
@Autowired
private IBarcodeManager barcodeManager;
@Autowired
private IDataLogManager dataLogManager;
@ApiOperation("原材料CTU获取线体到架子的入库任务(入满箱或出库后回库)")
@RequestMapping("/lineToShelfTasks")
......@@ -102,7 +114,7 @@ public class CtuDeviceController {
//手动出库 不发给CTU
Object manualOut = dataLog.getExtraDataMap("manualOut");
if (manualOut != null){
if (manualOut != null) {
continue;
}
//当大于6个时候,判断目的地是否为出料口
......@@ -146,7 +158,6 @@ public class CtuDeviceController {
}
@ApiOperation("所有原材料CTU获取架子到线体的出库任务(出空箱到入料机构或出库到出料机构)")
@RequestMapping("/allShelfToLineTasks")
@AnonymousAccess
......@@ -160,7 +171,7 @@ public class CtuDeviceController {
//手动出库 不发给CTU
Object manualOut = dataLog.getExtraDataMap("manualOut");
if (manualOut != null){
if (manualOut != null) {
continue;
}
......@@ -195,6 +206,7 @@ public class CtuDeviceController {
public ResultBean updateTaskStatus(@RequestBody Map<String, String> paramMap) {
String boxStr = paramMap.get("boxStr");
String statusStr = paramMap.get("statusStr");
String type = paramMap.get("type");
//1.判断任务是否存在
DataLog task = null;
......@@ -208,7 +220,43 @@ public class CtuDeviceController {
}
}
if (task == null) {
return ResultBean.newErrorResult(-1, "smfcore.task.notExist", "任务不存在");
if (StringUtils.isNotEmpty(type) && OP_STATUS.FINISHED.name().equals(statusStr)) {
log.info(task.getBarcode() + "对应的任务不存在,任务类型为:" + type);
StoragePos pos = storagePosManager.findOne(new Query(Criteria.where("barcode.barcode").is(task.getBarcode())));
if (pos == null) {
return ResultBean.newErrorResult(-1, "", task.getBarcode() + "对应的库位不存在,请在库位管理里查看");
}
Barcode barcode = pos.getBarcode();
Storage storage = dataCache.getStorageById(pos.getStorageId());
log.info(task.getBarcode() + "对应的库位为:" + pos.getPosName(), "是否在库:" + barcode.getStatus());
if ("1".equals(type)) {
if (barcode.getStatus() != BARCODE_STATUS.IN_STORE) {
barcode.setStatus(BARCODE_STATUS.IN_STORE);
barcodeManager.save(barcode);
pos.setBarcode(barcode);
storagePosManager.save(pos);
DataLog dataLog = new DataLog(storage, barcode, pos);
dataLog.setStatus(OP_STATUS.FINISHED.name());
dataLog.setType(OP.PUT_IN);
dataLog.setOperator("任务不存在,自动创建");
dataLogManager.save(dataLog);
}
} else if ("2".equals(type)) {
if (barcode.getStatus() != BARCODE_STATUS.OUT_NORMAL) {
barcode.setStatus(BARCODE_STATUS.OUT_NORMAL);
barcodeManager.save(barcode);
pos.setBarcode(barcode);
storagePosManager.save(pos);
DataLog dataLog = new DataLog(storage, barcode, pos);
dataLog.setStatus(OP_STATUS.FINISHED.name());
dataLog.setType(OP.CHECKOUT);
dataLog.setOperator("任务不存在,自动创建");
dataLogManager.save(dataLog);
}
}
}
return ResultBean.newOkResult("");
//return ResultBean.newErrorResult(-1, "smfcore.task.notExist", "任务不存在");
}
statusStr = statusStr.toUpperCase();
......@@ -220,7 +268,8 @@ public class CtuDeviceController {
//2.判断更新状态和当前状态任务是否相同
if (task.getStatus().equals(statusStr)) {
return ResultBean.newErrorResult(-1, "smfcore.taskStatusHasUpdate", "任务{0}已经修改状态", new String[]{task.getBarcode()});
return ResultBean.newOkResult("");
//return ResultBean.newErrorResult(-1, "smfcore.taskStatusHasUpdate", "任务{0}已经修改状态", new String[]{task.getBarcode()});
}
//入库,在AGV上,清空出料机构缓存
......@@ -231,7 +280,7 @@ public class CtuDeviceController {
//3.判断是出库,还是入库任务
if (task.isPutInTask()) {
task.setStatus(statusStr);
if (OP_STATUS.EXECUTING.name().equals(statusStr) || OP_STATUS.WAIT.name().equals(statusStr)){
if (OP_STATUS.EXECUTING.name().equals(statusStr) || OP_STATUS.WAIT.name().equals(statusStr)) {
taskService.updateQueueTask(task);
} else {
taskService.moveTaskToFinished(task);
......@@ -291,7 +340,22 @@ public class CtuDeviceController {
public ResultBean updateMaterPutInCache(@RequestParam("boxStr") String boxStr,
@RequestParam("loc") String loc) {
log.info("更新料箱位置信息,料箱号为:"+boxStr+"当前位置为:"+loc);
log.info("更新料箱位置信息,料箱号为:" + boxStr + "当前位置为:" + loc);
//转化,兼容以前的
if (TaskCurrentLoc.Out1_FeedingInlet.equals(loc)) {
loc = TaskCurrentLoc.OutLine01_In;
} else if (TaskCurrentLoc.Out2_FeedingInlet.equals(loc)) {
loc = TaskCurrentLoc.OutLine02_In;
} else if (TaskCurrentLoc.Out3_FeedingInlet.equals(loc)) {
loc = TaskCurrentLoc.OutLine03_In;
} else if (TaskCurrentLoc.Out4_FeedingInlet.equals(loc)) {
loc = TaskCurrentLoc.OutLine04_In;
} else if (TaskCurrentLoc.Out5_FeedingInlet.equals(loc)) {
loc = TaskCurrentLoc.OutLine05_In;
} else if (TaskCurrentLoc.Out6_FeedingInlet.equals(loc)) {
loc = TaskCurrentLoc.OutLine06_In;
}
DataLog dataLog = null;
List<DataLog> allTasks = taskService.getAllTasks();
......@@ -305,27 +369,12 @@ public class CtuDeviceController {
}
if (dataLog != null) {
dataLog.setCurrentLoc(loc);
if (TaskCurrentLoc.In1_FeedingInlet.equals(loc)
|| TaskCurrentLoc.In2_FeedingInlet.equals(loc)
|| TaskCurrentLoc.In2_FeedingInlet.equals(loc)
|| TaskCurrentLoc.In3_FeedingInlet.equals(loc)
|| TaskCurrentLoc.In4_FeedingInlet.equals(loc)
|| TaskCurrentLoc.Out1_FeedingInlet.equals(loc)
|| TaskCurrentLoc.Out2_FeedingInlet.equals(loc)
|| TaskCurrentLoc.Out3_FeedingInlet.equals(loc)
|| TaskCurrentLoc.Out4_FeedingInlet.equals(loc)
) {
if (dataLog.isCheckOutTask()) {
dataLog.setStatus(loc);
}
}
if (dataLog.isExecuting() || dataLog.isWait()){
if (dataLog.isExecuting() || dataLog.isWait()) {
taskService.updateQueueTask(dataLog);
} else {
taskService.moveTaskToFinished(dataLog);
taskService.updateFinishedTask(dataLog);
}
} else {
Barcode barcode = codeResolve.resolveOneValideBarcode(boxStr);
StoragePos storagePos = BoxHandleUtil.locOnePos(barcode);
......@@ -341,15 +390,16 @@ public class CtuDeviceController {
}
}
if (TaskCurrentLoc.Out1_FeedingInlet.equals(loc)
|| TaskCurrentLoc.Out2_FeedingInlet.equals(loc)
|| TaskCurrentLoc.Out3_FeedingInlet.equals(loc)
|| TaskCurrentLoc.Out4_FeedingInlet.equals(loc)
|| TaskCurrentLoc.Out5_FeedingInlet.equals(loc)
|| TaskCurrentLoc.Out6_FeedingInlet.equals(loc)){
RawOutUtil.updateRawOutBox(boxStr,loc);
if (
TaskCurrentLoc.OutLine01_In.equals(loc)
|| TaskCurrentLoc.OutLine02_In.equals(loc)
|| TaskCurrentLoc.OutLine03_In.equals(loc)
|| TaskCurrentLoc.OutLine04_In.equals(loc)
|| TaskCurrentLoc.OutLine05_In.equals(loc)
|| TaskCurrentLoc.OutLine06_In.equals(loc)
) {
RawOutUtil.updateRawOutBox(boxStr, loc);
}
return ResultBean.newOkResult("");
}
......@@ -360,9 +410,9 @@ public class CtuDeviceController {
public ResultBean manualCanPut() {
List<DataLog> allTasks = taskService.getAllTasks();
for (DataLog dataLog : allTasks) {
if (dataLog.isCheckOutTask() && !dataLog.isFinished() && !dataLog.isCancel()){
if (TaskCurrentLoc.Manual_FeedingInlet.equals(dataLog.getCurrentLoc())){
return ResultBean.newErrorResult(-1,"",dataLog.getBarcode()+"正在操作工位上,请核实");
if (dataLog.isCheckOutTask() && !dataLog.isFinished() && !dataLog.isCancel()) {
if (TaskCurrentLoc.Manual_FeedingInlet.equals(dataLog.getCurrentLoc())) {
return ResultBean.newErrorResult(-1, "", dataLog.getBarcode() + "正在操作工位上,请核实");
}
}
}
......@@ -384,12 +434,12 @@ public class CtuDeviceController {
//查找所有库位信息
//log.info("开始时间:"+System.currentTimeMillis());
List<StoragePos> storagePosList = storagePosManager.findNotEmptyBarcodeByStorageId(storageId);
if (storagePosList == null || storagePosList.isEmpty()) {
if (storagePosList == null || storagePosList.isEmpty()) {
return ResultBean.newErrorResult(-1, "", "未找到可用料箱");
}
//log.info("结束时间:"+System.currentTimeMillis());
List<Map<String,Object>> resultList = new ArrayList<>();
List<Map<String, Object>> resultList = new ArrayList<>();
//循环判断是否可用
List<DataLog> allTasks = taskService.getAllTasks();
......@@ -398,8 +448,8 @@ public class CtuDeviceController {
for (StoragePos pos : storagePosList) {
Barcode barcode = pos.getBarcode();
if (barcode != null){
if (barcode.getStatus() != BARCODE_STATUS.IN_STORE){
if (barcode != null) {
if (barcode.getStatus() != BARCODE_STATUS.IN_STORE) {
continue;
}
......@@ -407,57 +457,57 @@ public class CtuDeviceController {
//判断是否可用
List<Barcode> subCodeList = barcode.getSubCodeList();
if (subCodeList == null || subCodeList.isEmpty()){
if ("C07".equals(barcode.getPartNumber())){
if (subCodeList == null || subCodeList.isEmpty()) {
if ("C07".equals(barcode.getPartNumber())) {
count = 6;
} else if ("C13".equals(barcode.getPartNumber()) || "C15".equals(barcode.getPartNumber())){
} else if ("C13".equals(barcode.getPartNumber()) || "C15".equals(barcode.getPartNumber())) {
count = 3;
}
} else {
Map<String, List<Barcode>> posNameMap = subCodeList.stream().collect(Collectors.groupingBy(Barcode::getPosName));
if ("C07".equals(barcode.getPartNumber())){
if ("C07".equals(barcode.getPartNumber())) {
count = 6 - posNameMap.keySet().size();
} else if ("C13".equals(barcode.getPartNumber()) || "C15".equals(barcode.getPartNumber())){
} else if ("C13".equals(barcode.getPartNumber()) || "C15".equals(barcode.getPartNumber())) {
count = 3 - posNameMap.keySet().size();
}
}
if (count == 0){
if (count == 0) {
continue;
}
//判断是否有任务
boolean hasTask = false;
for (DataLog dataLog : allTasks) {
if (!dataLog.isCancel() && !dataLog.isFinished()){
if (barcode.getBarcode().equals(dataLog.getBarcode())){
if (!dataLog.isCancel() && !dataLog.isFinished()) {
if (barcode.getBarcode().equals(dataLog.getBarcode())) {
hasTask = true;
break;
}
}
}
if (hasTask){
if (hasTask) {
continue;
}
String size = "";
String boxStr = barcode.getBarcode();
if (boxStr.startsWith("C07")){
if (boxStr.startsWith("C07")) {
size = "7";
} else if (boxStr.startsWith("C13")){
} else if (boxStr.startsWith("C13")) {
size = "13";
}else if (boxStr.startsWith("C15")){
} else if (boxStr.startsWith("C15")) {
size = "15";
}
Map<String,Object> resultMap = new HashMap<>();
resultMap.put("box",boxStr);
resultMap.put("size",size);
String binCode = boxStr+"-01";
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("box", boxStr);
resultMap.put("size", size);
String binCode = boxStr + "-01";
String warehouseCode = StringUtils.isNotEmpty(binCodeCacheMap.get(binCode)) ? binCodeCacheMap.get(binCode) : "";
resultMap.put("warehouseCode",warehouseCode);
resultMap.put("remainNum",count);
resultMap.put("posName",pos.getPosName());
resultMap.put("warehouseCode", warehouseCode);
resultMap.put("remainNum", count);
resultMap.put("posName", pos.getPosName());
resultList.add(resultMap);
}
}
......@@ -474,21 +524,21 @@ public class CtuDeviceController {
@ApiOperation("CTU通知生成出库任务")
@RequestMapping("/boxCheckOut")
@AnonymousAccess
public ResultBean boxCheckOut(@RequestBody List<String> boxList){
if (boxList == null || boxList.isEmpty()){
return ResultBean.newErrorResult(-1,"","传入的料箱号不能为空");
public ResultBean boxCheckOut(@RequestBody List<String> boxList) {
if (boxList == null || boxList.isEmpty()) {
return ResultBean.newErrorResult(-1, "", "传入的料箱号不能为空");
}
String boxListStr = JSONObject.toJSONString(boxList);
log.info("CTU生成出库任务,料箱号为:"+boxListStr);
log.info("CTU生成出库任务,料箱号为:" + boxListStr);
List<Map<String,String>> resultList = new ArrayList<>();
List<Map<String, String>> resultList = new ArrayList<>();
List<DataLog> allTasks = taskService.getAllTasks();
List<StoragePos> storagePosList = storagePosManager.findByQuery(new Query(Criteria.where("barcode.barcode").in(boxList)));
if (storagePosList == null || storagePosList.isEmpty()){
return ResultBean.newErrorResult(-1,"",boxList+"未在库位中找到料箱");
if (storagePosList == null || storagePosList.isEmpty()) {
return ResultBean.newErrorResult(-1, "", boxList + "未在库位中找到料箱");
}
for (StoragePos pos : storagePosList) {
......@@ -530,7 +580,7 @@ public class CtuDeviceController {
//生成出库任务
String storageId = pos.getStorageId();
Storage storage = dataCache.getStorageById(storageId);
if (storage.isVirtual()){
if (storage.isVirtual()) {
log.info(barcode.getBarcode() + "料箱在虚拟仓中,跳过");
continue;
}
......@@ -542,15 +592,15 @@ public class CtuDeviceController {
dataLog.setOperator("CTU呼叫到入料机构");
taskService.addTaskToExecute(dataLog);
Map<String,String> resultMap = new HashMap<>();
resultMap.put("box",barcode.getBarcode());
resultMap.put("posName",pos.getPosName());
Map<String, String> resultMap = new HashMap<>();
resultMap.put("box", barcode.getBarcode());
resultMap.put("posName", pos.getPosName());
resultList.add(resultMap);
}
}
if (resultList == null || resultList.isEmpty()){
return ResultBean.newErrorResult(-1,"",boxList+"未找到符合条件的下架任务");
if (resultList == null || resultList.isEmpty()) {
return ResultBean.newErrorResult(-1, "", boxList + "未找到符合条件的下架任务");
}
return ResultBean.newOkResult(resultList);
......@@ -593,9 +643,9 @@ public class CtuDeviceController {
resultMap.put("loc", currentLoc);
resultMap.put("type", type);
resultMap.put("outMap", outMap);
resultMap.put("posName", barcode.getPosName());
resultList.add(resultMap);
}
return ResultBean.newOkResult(resultList);
}
......@@ -628,21 +678,90 @@ public class CtuDeviceController {
@ApiOperation("获取入库分拣机上的数量")
@RequestMapping("/getRawInStackerNum")
@AnonymousAccess
public ResultBean getRawInStackerNum(){
List<Map<String,String>> resultList = new ArrayList<>();
public ResultBean getRawInStackerNum() {
List<Map<String, String>> resultList = new ArrayList<>();
Set<String> stackerSet = RawInLineUtil.getAllRawInStacker();
for (String stacker : stackerSet) {
if (!MaterialUtil.bindInfo(stacker)){
if (!MaterialUtil.bindInfo(stacker)) {
continue;
} else {
String size = MaterialUtil.getMaterialSize(stacker);
Map<String,String> resultMap = new HashMap<>();
resultMap.put("stacker",stacker);
resultMap.put("size",size);
Map<String, String> resultMap = new HashMap<>();
resultMap.put("stacker", stacker);
resultMap.put("size", size);
resultList.add(resultMap);
}
}
return ResultBean.newOkResult(resultList);
}
@ApiOperation("获取入库分拣机上的空闲料箱")
@RequestMapping("/getRawInBoxNum")
@AnonymousAccess
public ResultBean getRawInBoxNum() {
Map<String, List<String>> boxMap = new HashMap<>();
List<DataLog> allTasks = taskService.getAllTasks();
//获取到对应工位,所在料箱数据
for (DataLog dataLog : allTasks) {
if (!dataLog.isCancel() && !dataLog.isFinished() && dataLog.isCheckOutTask()) {
String currentLoc = dataLog.getCurrentLoc();
if (TaskCurrentLoc.In1_FeedingInlet.equals(currentLoc)
|| TaskCurrentLoc.In2_FeedingInlet.equals(currentLoc)
|| TaskCurrentLoc.In3_FeedingInlet.equals(currentLoc)
|| TaskCurrentLoc.In4_FeedingInlet.equals(currentLoc)
|| TaskCurrentLoc.In5_FeedingInlet.equals(currentLoc)
|| TaskCurrentLoc.In6_FeedingInlet.equals(currentLoc)
) {
List<String> boxList = boxMap.get(currentLoc);
if (boxList == null) {
boxList = new ArrayList<>();
}
boxList.add(dataLog.getBarcode());
boxMap.put(currentLoc, boxList);
}
}
}
//判断有没有剩余的箱子
List<Map<String,Object>> resultList = new ArrayList<>();
for (String loc : boxMap.keySet()) {
String cid = "";
if (TaskCurrentLoc.In1_FeedingInlet.equals(loc)) {
cid = StorageNameConfig.rawMaterialIn01;
} else if (TaskCurrentLoc.In2_FeedingInlet.equals(loc)) {
cid = StorageNameConfig.rawMaterialIn02;
} else if (TaskCurrentLoc.In3_FeedingInlet.equals(loc)) {
cid = StorageNameConfig.rawMaterialIn03;
} else if (TaskCurrentLoc.In4_FeedingInlet.equals(loc)) {
cid = StorageNameConfig.rawMaterialIn04;
} else if (TaskCurrentLoc.In5_FeedingInlet.equals(loc)) {
cid = StorageNameConfig.rawMaterialIn05;
} else if (TaskCurrentLoc.In6_FeedingInlet.equals(loc)) {
cid = StorageNameConfig.rawMaterialIn06;
}
List<String> boxList = boxMap.get(loc);
EquipStatusBean statusBean = EquipStatusUtil.getStatusBean(cid);
if (statusBean != null && !statusBean.timeOut()){
Map<String, Object> data = statusBean.getData();
if (data != null){
if (data.get("workingBox") != null){
String workingBox = data.get("workingBox").toString();
log.info("入料机构不可用的箱子号为:"+workingBox+",位置为:"+loc);
String[] workingBoxSpl = workingBox.split(",");
for (String boxStr : workingBoxSpl) {
boxList.remove(boxStr);
}
}
}
}
Map<String,Object> resultMap = new HashMap<>();
resultMap.put("station",loc);
resultMap.put("canUsedNum",boxList.size()+"");
resultMap.put("boxList",boxList);
resultList.add(resultMap);
}
return ResultBean.newOkResult(resultList);
}
}
......@@ -8,6 +8,8 @@ public class TaskCurrentLoc {
public static final String In2_FeedingInlet = "In2_FeedingInlet";
public static final String In3_FeedingInlet = "In3_FeedingInlet";
public static final String In4_FeedingInlet = "In4_FeedingInlet";
public static final String In5_FeedingInlet = "In5_FeedingInlet";
public static final String In6_FeedingInlet = "In6_FeedingInlet";
public static final String In_FeedingInlet = "In_FeedingInlet";
public static final String Out1_FeedingInlet = "Out1_FeedingInlet";
......@@ -18,10 +20,19 @@ public class TaskCurrentLoc {
public static final String Out6_FeedingInlet = "Out6_FeedingInlet";
public static final String Out_FeedingInlet = "Out_FeedingInlet";
public static final String OutLine01_In = "outLine01_in";
public static final String OutLine02_In = "outLine02_in";
public static final String OutLine03_In = "outLine03_in";
public static final String OutLine04_In = "outLine04_in";
public static final String OutLine05_In = "outLine05_in";
public static final String OutLine06_In = "outLine06_in";
public static final String In1_DischargeHole = "In1_DischargeHole";
public static final String In2_DischargeHole = "In2_DischargeHole";
public static final String In3_DischargeHole = "In3_DischargeHole";
public static final String In4_DischargeHole = "In4_DischargeHole";
public static final String In5_DischargeHole = "In5_DischargeHole";
public static final String In6_DischargeHole = "In6_DischargeHole";
public static final String Out1_DischargeHole = "Out1_DischargeHole";
public static final String Out2_DischargeHole = "Out2_DischargeHole";
......
......@@ -89,69 +89,36 @@ public class RawInLineUtil {
}
private static String getNextLoc(String material, String loc) {
String materialSize = MaterialUtil.getMaterialSize(material);
//Map<String, RawInLineMaterialLoc> destinationMap = dataCache.getCache(CacheNameUtil.CHCHE_RAWIN_LINE_MATERIAL_DESTINATION);
String nextLoc = "";
if ("13".equals(materialSize) || "15".equals(materialSize)) {
log.info(material + "的尺寸为:" + material + "直接分配到1号工位");
//判断1号是否要料串
EquipStatusBean statusBean = EquipStatusUtil.getStatusBean(rawInLine01);
if (loc.equals(forkLoc) || loc.equals(emptyForkLoc)) {
nextLoc = rawInLine02;
updateDestinationMap(material, loc, nextLoc);
} else {
//7寸料串,直接到2号分拣机
EquipStatusBean statusBean = EquipStatusUtil.getStatusBean(loc);
if (statusBean != null) {
int status = statusBean.getStatus();
log.info(loc + "的状态为:" + status);
if (10 == status) {
nextLoc = rawInLine01;
if (loc.equals(rawInLine01)) {
updateDestinationMap(material, loc, nextLoc);
} else {
updateDestinationMap(material, loc + "_to_" + nextLoc, nextLoc);
}
nextLoc = loc;
updateDestinationMap(material, loc, nextLoc);
return nextLoc;
}
}
if (!loc.equals(rawInLine01)) {
nextLoc = rawInLine01;
} else {
if (rawInLine01.equals(loc)) {
nextLoc = rawInLine02;
} else if (rawInLine02.equals(loc)) {
nextLoc = rawInLine03;
} else if (rawInLine03.equals(loc)) {
nextLoc = rawInLine04;
} else if (rawInLine04.equals(loc)) {
nextLoc = rawInLine05;
} else if (rawInLine05.equals(loc)) {
nextLoc = rawInLine06;
} else if (rawInLine06.equals(loc)) {
nextLoc = rawInLine01;
}
updateDestinationMap(material, loc + "_to_" + nextLoc, nextLoc);
} else {
if (loc.equals(forkLoc) || loc.equals(emptyForkLoc)) {
nextLoc = rawInLine02;
updateDestinationMap(material, loc, nextLoc);
} else {
//7寸料串,直接到2号分拣机
if (loc.equals(rawInLine01)){
nextLoc = rawInLine02;
updateDestinationMap(material, loc + "_to_" + nextLoc, nextLoc);
} else {
EquipStatusBean statusBean = EquipStatusUtil.getStatusBean(loc);
if (statusBean != null) {
int status = statusBean.getStatus();
log.info(loc + "的状态为:" + status);
if (10 == status) {
nextLoc = loc;
updateDestinationMap(material, loc, nextLoc);
return nextLoc;
}
}
if (rawInLine02.equals(loc)) {
nextLoc = rawInLine03;
} else if (rawInLine03.equals(loc)) {
nextLoc = rawInLine04;
} else if (rawInLine04.equals(loc)) {
nextLoc = rawInLine05;
} else if (rawInLine05.equals(loc)) {
nextLoc = rawInLine06;
} else if (rawInLine06.equals(loc)) {
nextLoc = rawInLine02;
}
}
updateDestinationMap(material, loc + "_to_" + nextLoc, nextLoc);
}
}
return nextLoc;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!