流利架入库出库逻辑
This commit is contained in:
@@ -36,7 +36,7 @@ public class AgvController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推送出库任务
|
* 接收出库任务
|
||||||
* @param mydoJob
|
* @param mydoJob
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -45,6 +45,17 @@ public class AgvController extends BaseController {
|
|||||||
return apiService.receiveOutMydoJob(mydoJob);
|
return apiService.receiveOutMydoJob(mydoJob);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收流利架空料箱入库任务
|
||||||
|
* @param mydoJob
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/receiveInMydoJob")
|
||||||
|
public AjaxResult receiveInMydoJob(@RequestBody MydoJob mydoJob) {
|
||||||
|
return apiService.receiveInMydoJob(mydoJob);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* agv搬运作业
|
* agv搬运作业
|
||||||
* @param genAgvSchedulingTaskRequest
|
* @param genAgvSchedulingTaskRequest
|
||||||
|
|||||||
@@ -110,4 +110,9 @@ public interface IApiService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public GenAgvSchedulingTaskResponse requestAgvQueue(AgvQueue agvQueue);
|
public GenAgvSchedulingTaskResponse requestAgvQueue(AgvQueue agvQueue);
|
||||||
|
/**
|
||||||
|
* WMS流利架入库任务推送
|
||||||
|
* @param mydoJob
|
||||||
|
*/
|
||||||
|
AjaxResult receiveInMydoJob(MydoJob mydoJob);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -210,27 +210,37 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
} else if ("2".equals(agvQueue.getWmsTaskType())) {
|
} else if ("2".equals(agvQueue.getWmsTaskType())) {
|
||||||
//通知wms 任务结束
|
if (agvQueue.getPositionCode2().startsWith("fluent")){
|
||||||
param.put("taskNo", agvQueue.getWmsTaskNo());
|
//流利架出库 同步电子标签
|
||||||
param.put("trayCode", agvQueue.getWmsTraycode());
|
Map<String, Object> fluentPickParam = new HashMap<>();
|
||||||
//写入对应的plc 任务号
|
fluentPickParam.put("taskNo", agvQueue.getWmsTaskNo());
|
||||||
DeviceSsj deviceSsj = PlcRead.deviceMap.get(agvQueue.getPositionCode2());
|
fluentPickParam.put("wmsType", "2");
|
||||||
if (ObjUtil.isNotNull(deviceSsj)) {
|
fluentPickParam.put("pickSsj", agvQueue.getPositionCode2());
|
||||||
SendData rwh = new SendData(Tools.DINT, agvQueue.getWmsTaskNo());
|
RequestLog requestLog = finishMydoJob(JOB_FINISH_URL, "流利架任务到达拣选口", fluentPickParam);
|
||||||
byte[] bytes = Tools.sendData(rwh);
|
log.info("【AGV流利架任务结束】任务号:{},返回结果{}", taskCode, requestLog);
|
||||||
//写入信息 取货完成
|
}else {
|
||||||
int i = PlcRead.WriteToSSJ(deviceSsj.getPlcDbWriteAddress(), bytes);
|
//输送机出库 PLC写入任务号
|
||||||
if (i == 1) {
|
//通知wms 任务结束
|
||||||
agvQueue.setFinishTime(DateUtil.formatDateTime(new Date()));
|
param.put("taskNo", agvQueue.getWmsTaskNo());
|
||||||
agvQueueService.updateAgvQueue(agvQueue);
|
param.put("trayCode", agvQueue.getWmsTraycode());
|
||||||
//插入历史
|
//写入对应的plc 任务号
|
||||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
DeviceSsj deviceSsj = PlcRead.deviceMap.get(agvQueue.getPositionCode2());
|
||||||
//删除队列
|
if (ObjUtil.isNotNull(deviceSsj)) {
|
||||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
SendData rwh = new SendData(Tools.DINT, agvQueue.getWmsTaskNo());
|
||||||
log.info("【AGV出库任务结束】任务号:{}", taskCode);
|
byte[] bytes = Tools.sendData(rwh);
|
||||||
|
//写入信息 取货完成
|
||||||
|
int i = PlcRead.WriteToSSJ(deviceSsj.getPlcDbWriteAddress(), bytes);
|
||||||
|
if (i == 1) {
|
||||||
|
agvQueue.setFinishTime(DateUtil.formatDateTime(new Date()));
|
||||||
|
agvQueueService.updateAgvQueue(agvQueue);
|
||||||
|
//插入历史
|
||||||
|
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||||
|
//删除队列
|
||||||
|
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||||
|
log.info("【AGV出库任务结束】任务号:{}", taskCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ("3".equals(agvQueue.getWmsTaskType())) {
|
} else if ("3".equals(agvQueue.getWmsTaskType())) {
|
||||||
param.put("positionCode1", agvQueue.getPositionCode1());
|
param.put("positionCode1", agvQueue.getPositionCode1());
|
||||||
param.put("positionCode2", agvQueue.getPositionCode2());
|
param.put("positionCode2", agvQueue.getPositionCode2());
|
||||||
@@ -289,6 +299,17 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult receiveInMydoJob(MydoJob mydoJob) {
|
||||||
|
AgvQueue agvQueue = createAgvQueue(mydoJob.getEntranceId(),mydoJob.getCargoSpaceId(),mydoJob.getTrayCode(),mydoJob.getTaskNo(),"1");
|
||||||
|
if (agvQueue != null){
|
||||||
|
return AjaxResult.success(agvQueue);
|
||||||
|
}else {
|
||||||
|
return AjaxResult.error("生成agv任务失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成agv队列
|
* 生成agv队列
|
||||||
* @param code1 起点
|
* @param code1 起点
|
||||||
@@ -377,4 +398,5 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
return genAgvSchedulingTask(genAgvSchedulingTaskRequest);
|
return genAgvSchedulingTask(genAgvSchedulingTaskRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,11 +46,16 @@ public class BsInSsjThread implements Runnable {
|
|||||||
ssjCodeList.put("ssjIn", ssjCodes);
|
ssjCodeList.put("ssjIn", ssjCodes);
|
||||||
//流利架
|
//流利架
|
||||||
ArrayList<String> ssjCodes2 = new ArrayList<>();
|
ArrayList<String> ssjCodes2 = new ArrayList<>();
|
||||||
ssjCodes2.add("LLJ1");
|
ssjCodes2.add("fluent1-11");
|
||||||
ssjCodes2.add("LLJ2");
|
ssjCodes2.add("fluent1-12");
|
||||||
ssjCodes2.add("LLJ3");
|
ssjCodes2.add("fluent1-13");
|
||||||
ssjCodes2.add("LLJ4");
|
ssjCodes2.add("fluent1-14");
|
||||||
ssjCodes2.add("LLJ5");
|
ssjCodes2.add("fluent1-15");
|
||||||
|
ssjCodes2.add("fluent2-11");
|
||||||
|
ssjCodes2.add("fluent2-12");
|
||||||
|
ssjCodes2.add("fluent2-13");
|
||||||
|
ssjCodes2.add("fluent2-14");
|
||||||
|
ssjCodes2.add("fluent2-15");
|
||||||
ssjCodeList.put("fluentIn", ssjCodes2);
|
ssjCodeList.put("fluentIn", ssjCodes2);
|
||||||
|
|
||||||
apiService = SpringUtils.getBean(IApiService.class);
|
apiService = SpringUtils.getBean(IApiService.class);
|
||||||
@@ -84,7 +89,7 @@ public class BsInSsjThread implements Runnable {
|
|||||||
//流利架 空料箱入库
|
//流利架 空料箱入库
|
||||||
for (String lljCode : ssjCodeList.get(type)) {
|
for (String lljCode : ssjCodeList.get(type)) {
|
||||||
try {
|
try {
|
||||||
//inLljDispatch(lljCode);
|
inLljDispatch(lljCode);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class BsOutSsjThread implements Runnable {
|
|||||||
//流利架出口
|
//流利架出口
|
||||||
for (String ssjCode : ssjCodeList.get(type)) {
|
for (String ssjCode : ssjCodeList.get(type)) {
|
||||||
try {
|
try {
|
||||||
//fluentOutDispatch(ssjCode);
|
fluentOutDispatch(ssjCode);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
@@ -126,9 +126,21 @@ public class BsOutSsjThread implements Runnable {
|
|||||||
for (AgvQueue queue : agvQueueList) {
|
for (AgvQueue queue : agvQueueList) {
|
||||||
//修改实际流利架货位
|
//修改实际流利架货位
|
||||||
BasFluentFrame basFluentFrame = basFluentFrameService.selectBasFluentFrameOrderByAllotNum(queue.getPositionCode2());
|
BasFluentFrame basFluentFrame = basFluentFrameService.selectBasFluentFrameOrderByAllotNum(queue.getPositionCode2());
|
||||||
queue.setPositionCode2(basFluentFrame.getLocationName());
|
if (basFluentFrame != null){
|
||||||
agvQueueService.updateAgvQueue(queue);
|
queue.setPositionCode2(basFluentFrame.getLocationName());
|
||||||
apiService.requestAgvQueue(queue);
|
agvQueueService.updateAgvQueue(queue);
|
||||||
|
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = apiService.requestAgvQueue(queue);
|
||||||
|
if (genAgvSchedulingTaskResponse.getCode() == 0) {
|
||||||
|
//修改ctu执行状态
|
||||||
|
queue.setStatus("1");
|
||||||
|
agvQueueService.updateAgvQueue(queue);
|
||||||
|
log.info("向CTU下入库库作业");
|
||||||
|
//更新流利架
|
||||||
|
basFluentFrame.setTrayCode(queue.getWmsTraycode());
|
||||||
|
basFluentFrame.setAllotNum(1L);
|
||||||
|
basFluentFrameService.updateBasFluentFrame(basFluentFrame);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
<select id="selectBasFluentFrameOrderByAllotNum" resultMap="BasFluentFrameResult">
|
<select id="selectBasFluentFrameOrderByAllotNum" resultMap="BasFluentFrameResult">
|
||||||
select TOP 1 id, location_name, type, frame_id, box_num, tray_code, group_id, allot_num from bas_fluent_frame
|
select TOP 1 id, location_name, type, frame_id, box_num, tray_code, group_id, allot_num from bas_fluent_frame
|
||||||
where frame_id = #{frameId}
|
where frame_id = #{frameId} and type = '1' and allot_num = 0
|
||||||
order by allot_num asc
|
order by order_num asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertBasFluentFrame" parameterType="BasFluentFrame" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertBasFluentFrame" parameterType="BasFluentFrame" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
|||||||
Reference in New Issue
Block a user