流利架入库出库逻辑
This commit is contained in:
@@ -36,7 +36,7 @@ public class AgvController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送出库任务
|
||||
* 接收出库任务
|
||||
* @param mydoJob
|
||||
* @return
|
||||
*/
|
||||
@@ -45,6 +45,17 @@ public class AgvController extends BaseController {
|
||||
return apiService.receiveOutMydoJob(mydoJob);
|
||||
}
|
||||
|
||||
/**
|
||||
* 接收流利架空料箱入库任务
|
||||
* @param mydoJob
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/receiveInMydoJob")
|
||||
public AjaxResult receiveInMydoJob(@RequestBody MydoJob mydoJob) {
|
||||
return apiService.receiveInMydoJob(mydoJob);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* agv搬运作业
|
||||
* @param genAgvSchedulingTaskRequest
|
||||
|
||||
@@ -110,4 +110,9 @@ public interface IApiService
|
||||
* @return
|
||||
*/
|
||||
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())) {
|
||||
//通知wms 任务结束
|
||||
param.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
param.put("trayCode", agvQueue.getWmsTraycode());
|
||||
//写入对应的plc 任务号
|
||||
DeviceSsj deviceSsj = PlcRead.deviceMap.get(agvQueue.getPositionCode2());
|
||||
if (ObjUtil.isNotNull(deviceSsj)) {
|
||||
SendData rwh = new SendData(Tools.DINT, agvQueue.getWmsTaskNo());
|
||||
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);
|
||||
if (agvQueue.getPositionCode2().startsWith("fluent")){
|
||||
//流利架出库 同步电子标签
|
||||
Map<String, Object> fluentPickParam = new HashMap<>();
|
||||
fluentPickParam.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
fluentPickParam.put("wmsType", "2");
|
||||
fluentPickParam.put("pickSsj", agvQueue.getPositionCode2());
|
||||
RequestLog requestLog = finishMydoJob(JOB_FINISH_URL, "流利架任务到达拣选口", fluentPickParam);
|
||||
log.info("【AGV流利架任务结束】任务号:{},返回结果{}", taskCode, requestLog);
|
||||
}else {
|
||||
//输送机出库 PLC写入任务号
|
||||
//通知wms 任务结束
|
||||
param.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
param.put("trayCode", agvQueue.getWmsTraycode());
|
||||
//写入对应的plc 任务号
|
||||
DeviceSsj deviceSsj = PlcRead.deviceMap.get(agvQueue.getPositionCode2());
|
||||
if (ObjUtil.isNotNull(deviceSsj)) {
|
||||
SendData rwh = new SendData(Tools.DINT, agvQueue.getWmsTaskNo());
|
||||
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())) {
|
||||
param.put("positionCode1", agvQueue.getPositionCode1());
|
||||
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队列
|
||||
* @param code1 起点
|
||||
@@ -377,4 +398,5 @@ public class ApiServiceImpl implements IApiService {
|
||||
return genAgvSchedulingTask(genAgvSchedulingTaskRequest);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -46,11 +46,16 @@ public class BsInSsjThread implements Runnable {
|
||||
ssjCodeList.put("ssjIn", ssjCodes);
|
||||
//流利架
|
||||
ArrayList<String> ssjCodes2 = new ArrayList<>();
|
||||
ssjCodes2.add("LLJ1");
|
||||
ssjCodes2.add("LLJ2");
|
||||
ssjCodes2.add("LLJ3");
|
||||
ssjCodes2.add("LLJ4");
|
||||
ssjCodes2.add("LLJ5");
|
||||
ssjCodes2.add("fluent1-11");
|
||||
ssjCodes2.add("fluent1-12");
|
||||
ssjCodes2.add("fluent1-13");
|
||||
ssjCodes2.add("fluent1-14");
|
||||
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);
|
||||
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
@@ -84,7 +89,7 @@ public class BsInSsjThread implements Runnable {
|
||||
//流利架 空料箱入库
|
||||
for (String lljCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
//inLljDispatch(lljCode);
|
||||
inLljDispatch(lljCode);
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class BsOutSsjThread implements Runnable {
|
||||
//流利架出口
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
//fluentOutDispatch(ssjCode);
|
||||
fluentOutDispatch(ssjCode);
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
@@ -126,9 +126,21 @@ public class BsOutSsjThread implements Runnable {
|
||||
for (AgvQueue queue : agvQueueList) {
|
||||
//修改实际流利架货位
|
||||
BasFluentFrame basFluentFrame = basFluentFrameService.selectBasFluentFrameOrderByAllotNum(queue.getPositionCode2());
|
||||
queue.setPositionCode2(basFluentFrame.getLocationName());
|
||||
agvQueueService.updateAgvQueue(queue);
|
||||
apiService.requestAgvQueue(queue);
|
||||
if (basFluentFrame != null){
|
||||
queue.setPositionCode2(basFluentFrame.getLocationName());
|
||||
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 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
|
||||
where frame_id = #{frameId}
|
||||
order by allot_num asc
|
||||
where frame_id = #{frameId} and type = '1' and allot_num = 0
|
||||
order by order_num asc
|
||||
</select>
|
||||
|
||||
<insert id="insertBasFluentFrame" parameterType="BasFluentFrame" useGeneratedKeys="true" keyProperty="id">
|
||||
|
||||
Reference in New Issue
Block a user