Commit 6ce4c4f7 孙克

增加原材料CTU获取入库/出库任务接口,接品描述详见修改记录

1 个父辈 2f07434e
...@@ -220,7 +220,7 @@ public class BaseDeviceHandler implements IDeviceHandler { ...@@ -220,7 +220,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
} }
//ReelLockPosUtil.removeReelLockPosInfo(barcodeSave.getBarcode()); //ReelLockPosUtil.removeReelLockPosInfo(barcodeSave.getBarcode());
return taskService.addPutInTaskToExecute(storage, barcodeSave, storagePos); return taskService.addPutInTaskToExecute(storage, barcodeSave, storagePos,"");
} }
} }
......
...@@ -111,11 +111,12 @@ public class TaskService { ...@@ -111,11 +111,12 @@ public class TaskService {
/** /**
* 条码入库,加入要执行的任务 * 条码入库,加入要执行的任务
*/ */
public synchronized DataLog addPutInTaskToExecute(Storage storage, Barcode barcode, StoragePos storagePos) throws ValidateException { public synchronized DataLog addPutInTaskToExecute(Storage storage, Barcode barcode, StoragePos storagePos, String boxLoc) throws ValidateException {
DataLog task = new DataLog(storage, barcode, storagePos); DataLog task = new DataLog(storage, barcode, storagePos);
task.setType(OP.PUT_IN); task.setType(OP.PUT_IN);
task.setStatus(OP_STATUS.WAIT.name()); task.setStatus(OP_STATUS.WAIT.name());
task.setLoc(boxLoc);
if (barcode != null) { if (barcode != null) {
task.setWarehouseCode(barcode.getWarehouseCode()); task.setWarehouseCode(barcode.getWarehouseCode());
task.setDescribe(barcode.getDescribe()); task.setDescribe(barcode.getDescribe());
......
...@@ -1418,7 +1418,8 @@ public class WarehouseController { ...@@ -1418,7 +1418,8 @@ public class WarehouseController {
DataLog task = null; DataLog task = null;
if (pos != null) { if (pos != null) {
Storage storage = dataCache.getStorageById(pos.getStorageId()); Storage storage = dataCache.getStorageById(pos.getStorageId());
task = generateTask(storage, pos.getBarcode(), pos, OP.CHECKOUT, OP_STATUS.WAIT.name(), name,ExtendType.STORAGE_CHECKOUT); String toLoc = "In_FeedingInlet";
task = generateTask(storage, pos.getBarcode(), pos, OP.CHECKOUT, OP_STATUS.WAIT.name(), toLoc,ExtendType.STORAGE_CHECKOUT);
} }
return task; return task;
} }
......
package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto;
import lombok.Data;
import java.util.Date;
/**
* @author sunke
* @date 2024/5/9 10:42
*/
@Data
public class CtuTask {
private String id;
/**
* 箱子号
*/
private String boxCode;
/**
* 任务类型, 入库=1或出库=2
*/
private int taskType;
/**
* 起点位置
* 料箱送到库位时,可能的值为In1_DischargeHole,In2_DischargeHole,Out1_DischargeHole,Out2_DischargeHole
* 料箱从库位取出时,值为库位号
*/
private String fromLoc;
/**
* 目的地位置
* 料箱送到库位时, 值为库位号
* 料箱从库位取出时,可能的值为In1_FeedingInlet,In2_FeedingInlet,Out1_FeedingInlet,Out2_FeedingInlet,In_FeedingInlet(入料机构入料口,不指定哪个入料机构),Out_FeedingInlet(出料机构入料口,不指定哪个出料机构)
*/
private String toLoc;
private Date createDate;
}
...@@ -29,6 +29,7 @@ import com.neotel.smfcore.custom.luxsan.api.LuxsanApi; ...@@ -29,6 +29,7 @@ import com.neotel.smfcore.custom.luxsan.api.LuxsanApi;
import com.neotel.smfcore.custom.luxsan.api.bean.request.NewLabelToCellRequest; import com.neotel.smfcore.custom.luxsan.api.bean.request.NewLabelToCellRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.request.PickingIssueRequest; import com.neotel.smfcore.custom.luxsan.api.bean.request.PickingIssueRequest;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.BindGrInfo; import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.BindGrInfo;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.CtuTask;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.LiteorderCheckType; import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.LiteorderCheckType;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BinCacheUtil; 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.BoxHandleUtil;
...@@ -39,6 +40,7 @@ import com.neotel.smfcore.security.annotation.AnonymousAccess; ...@@ -39,6 +40,7 @@ import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -247,12 +249,16 @@ public class CDeviceController { ...@@ -247,12 +249,16 @@ public class CDeviceController {
@ApiOperation("料箱入库,生成任务") @ApiOperation("料箱入库,生成任务")
@RequestMapping("/boxIntoPos") @RequestMapping("/boxIntoPos")
@AnonymousAccess @AnonymousAccess
public synchronized ResultBean boxIntoPos(String boxStr) { public synchronized ResultBean boxIntoPos(String boxStr, String boxLoc) {
log.info("料箱入库开始生成任务:"+boxStr); log.info("["+boxLoc + "]位置的料箱入库开始生成任务:"+boxStr);
if (StringUtils.isEmpty(boxStr)) { if (StringUtils.isEmpty(boxStr)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"料箱信息"}); return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"料箱信息"});
} }
// if (StringUtils.isEmpty(boxLoc)) {
// return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "料箱位置参数boxLoc不能为空");
// }
//1.判断有没有正在执行的任务 //1.判断有没有正在执行的任务
List<DataLog> taskList = taskService.getAllTasks(); List<DataLog> taskList = taskService.getAllTasks();
for (DataLog dataLog : taskList) { for (DataLog dataLog : taskList) {
...@@ -279,7 +285,7 @@ public class CDeviceController { ...@@ -279,7 +285,7 @@ public class CDeviceController {
//4.生成入库任务 //4.生成入库任务
Storage storage = dataCache.getStorageById(pos.getStorageId()); Storage storage = dataCache.getStorageById(pos.getStorageId());
DataLog dataLog = taskService.addPutInTaskToExecute(storage, boxBarcode, pos); DataLog dataLog = taskService.addPutInTaskToExecute(storage, boxBarcode, pos, boxLoc);
return ResultBean.newOkResult(dataLog); return ResultBean.newOkResult(dataLog);
} }
...@@ -510,6 +516,53 @@ public class CDeviceController { ...@@ -510,6 +516,53 @@ public class CDeviceController {
} }
@ApiOperation("原材料CTU获取线体到架子的入库任务(入满箱或出库后回库)")
@RequestMapping("/lineToShelfTasks")
@AnonymousAccess
public ResultBean lineToShelfTasks(){
List<DataLog> allTasks = taskService.getAllTasks();
List<CtuTask> lineToShelfTaskList = new ArrayList<>();
for (DataLog dataLog : allTasks) {
if (dataLog.isPutInTask() && dataLog.isWait()){
CtuTask ctuTask = new CtuTask();
ctuTask.setId(dataLog.getId());
ctuTask.setTaskType(dataLog.getType());
//起始点为线体传入的boxLoc值
ctuTask.setFromLoc(dataLog.getLoc());
//目的地都为库位
ctuTask.setToLoc(dataLog.getPosName());
ctuTask.setCreateDate(ctuTask.getCreateDate());
lineToShelfTaskList.add(ctuTask);
}
}
return ResultBean.newOkResult(lineToShelfTaskList);
}
@ApiOperation("原材料CTU获取架子到线体的出库任务(出空箱到入料机构或出库到出料机构)")
@RequestMapping("/shelfToLineTasks")
@AnonymousAccess
public ResultBean shelfToLineTasks(){
List<DataLog> allTasks = taskService.getAllTasks();
List<CtuTask> shelfToLineTaskList = new ArrayList<>();
for (DataLog dataLog : allTasks) {
if (dataLog.isCheckOutTask() && dataLog.isWait()){
CtuTask ctuTask = new CtuTask();
ctuTask.setId(dataLog.getId());
ctuTask.setTaskType(dataLog.getType());
ctuTask.setFromLoc(dataLog.getPosName());
//手动出空箱的目的地已经设置为In_FeedingInlet, 所以其他出库的未设置目的地的设置为Out_FeedingInlet
String toLoc = dataLog.getLoc();
if(Strings.isBlank(toLoc)){
toLoc = "Out_FeedingInlet";
}
ctuTask.setToLoc(toLoc);
ctuTask.setCreateDate(ctuTask.getCreateDate());
shelfToLineTaskList.add(ctuTask);
}
}
return ResultBean.newOkResult(shelfToLineTaskList);
}
@ApiOperation("根据料箱获取目的地") @ApiOperation("根据料箱获取目的地")
@RequestMapping("/getTargetByBox") @RequestMapping("/getTargetByBox")
@AnonymousAccess @AnonymousAccess
......
...@@ -78,7 +78,7 @@ public class BoxHandleUtil { ...@@ -78,7 +78,7 @@ public class BoxHandleUtil {
Barcode barcode = storagePos.getBarcode(); Barcode barcode = storagePos.getBarcode();
if (barcode == null) { if (barcode == null) {
log.warn("任务:" + opTask.getId() + " 仓位:" + opTask.getPosId() + " 的 Barcode 为null, 之前可能处理过,结束任务后直接返回"); log.warn("任务:" + opTask.getId() + " 仓位:" + opTask.getPosName() + " 的 Barcode 为null, 之前可能处理过,结束任务后直接返回");
return; return;
} }
......
...@@ -202,8 +202,10 @@ public class LineController { ...@@ -202,8 +202,10 @@ public class LineController {
//清理扫描的cartonId //清理扫描的cartonId
barcode.setScanCartonId(""); barcode.setScanCartonId("");
//4.生成入库任务 //4.生成入库任务
taskService.addPutInTaskToExecute(storage, barcode, pos); String boxLoc = "semiFinished_In";
taskService.addPutInTaskToExecute(storage, barcode, pos,boxLoc);
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }
......
...@@ -14,3 +14,82 @@ ...@@ -14,3 +14,82 @@
>> - msg:消息, >> - msg:消息,
>> - data: >> - data:
>> - validBinList: 可用的料格列表, 如果没有可用的料格, 那么列表为空 >> - validBinList: 可用的料格列表, 如果没有可用的料格, 那么列表为空
20240509 原材料CTU接口
1 原材料CTU获取线体到架子的入库任务(入满箱或出库后回库)
地址: /cdevice/lineToShelfTasks
参数: 无
返回:
{
"code":0,
"msg":"ok",
"data":[
{
"id":"123451",
"boxCode":"C0700025",
"taskType": 1,
"fromLoc": "In1_DischargeHole"
"toLoc":"1-10"
"createDate":"2024-05-09 12:24:35"
},
{
"id":"123461",
"boxCode":"C0700023",
"taskType": 1,
"fromLoc": "Out2_DischargeHole"
"toLoc":"1-15"
"createDate":"2024-05-09 12:24:35"
}
]
}`
>> - code: 0为正常,其他为异常
>> - msg:消息,
>> - data:
>> - id: 任务标识
>> - boxCode: 料箱编号
>> - taskType: 任务类型, 入库=1或出库=2
>> - fromLoc: 起点位置,可能的值为 In1_DischargeHole,In2_DischargeHole,Out1_DischargeHole,Out2_DischargeHole
>> - toLoc: 目的地位置,值为库位号
>> - createDate: 任务创建时间
2 原材料CTU获取架子到线体的出库任务(出空箱到入料机构或出库到出料机构)
地址: /cdevice/shelfToLineTasks
参数: 无
返回:
{
"code":0,
"msg":"ok",
"data":[
{
"id":"12345",
"boxCode":"C0700024",
"taskType": 2,
"fromLoc": "1-1"
"toLoc":"In_FeedingInlet"
"createDate":"2024-05-09 12:24:35"
},
{
"id":"12346",
"boxCode":"C0700023",
"taskType": 2,
"fromLoc": "1-5"
"toLoc":"出料机构入料口"
"createDate":"2024-05-09 12:24:35"
}
]
}`
>> - code: 0为正常,其他为异常
>> - msg:消息,
>> - data:
>> - id: 任务标识
>> - boxCode: 料箱编号
>> - taskType: 任务类型, 入库=1或出库=2
>> - fromLoc: 起点位置,值为库位号
>> - toLoc: 目的地位置,可能的值为 In1_FeedingInlet,In2_FeedingInlet,Out1_FeedingInlet,Out2_FeedingInlet,In_FeedingInlet(入料机构入料口,不指定哪个入料机构),Out_FeedingInlet(出料机构入料口,不指定哪个出料机构)
>> - createDate: 任务创建时间
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!