Compare commits
3 Commits
ad9f8d87fd
...
d98fe2a30c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d98fe2a30c | ||
|
|
af308d7dc9 | ||
|
|
fa9386773f |
@@ -12,6 +12,7 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRespons
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
|
||||
@@ -138,4 +139,10 @@ public interface IApiService
|
||||
AjaxResult allotSpace(JobParam jobParam);
|
||||
|
||||
AjaxResult JobFinish(Map<String, Object> param);
|
||||
|
||||
DeviceSsj getDeviceMsg(String taskNo);
|
||||
|
||||
DeviceSsj getDeviceMsgSsj(String entranceId);
|
||||
|
||||
AjaxResult OutMakeSure(HashMap<String, Object> map);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.device.ssj.service.IDeviceSsjService;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
@@ -51,6 +53,8 @@ public class ApiServiceImpl implements IApiService {
|
||||
private IAgvQueueService agvQueueService;
|
||||
@Autowired
|
||||
private IMydoJobService mydoJobService;
|
||||
@Autowired
|
||||
private IDeviceSsjService deviceSsjService;
|
||||
|
||||
|
||||
|
||||
@@ -469,4 +473,32 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceSsj getDeviceMsg(String taskNo) {
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Long.valueOf(taskNo));
|
||||
DeviceSsj ssj = new DeviceSsj();
|
||||
ssj.setDeviceCode(mydoJob.getEntranceId());
|
||||
List<DeviceSsj> deviceSsjs = deviceSsjService.selectDeviceSsjList(ssj);
|
||||
return deviceSsjs.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceSsj getDeviceMsgSsj(String entranceId) {
|
||||
DeviceSsj ssj = new DeviceSsj();
|
||||
ssj.setDeviceCode(entranceId);
|
||||
List<DeviceSsj> deviceSsjs = deviceSsjService.selectDeviceSsjList(ssj);
|
||||
return deviceSsjs.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult OutMakeSure(HashMap<String, Object> param) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(OUT_MAKE_SURE, "线边直出请求过账", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||
return AjaxResult.success(bean.getData());
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package com.ruoyi.common;
|
||||
|
||||
|
||||
import org.springframework.security.access.method.P;
|
||||
|
||||
public class Constant {
|
||||
|
||||
public static final String WMS_BASE_URL = "http://localhost:8080/api2wms/";
|
||||
public static final String RCS_BASE_URL = "http://127.0.0.1:8081/rcms-dps/rest/";
|
||||
public static final String AGV_BASE_URL = "http://127.0.0.1:9501/api/app/agvs-task";
|
||||
|
||||
public static final String WMS_BASE_PDA_URL = "http://localhost:8080/pda/";
|
||||
|
||||
public static final String JOB_FINISH_URL = WMS_BASE_URL+"jobFinish";
|
||||
public static final String CONTINUE_TASK_URL = RCS_BASE_URL+"continueTask";
|
||||
@@ -19,6 +21,7 @@ public class Constant {
|
||||
public static final String RE_MATERIAL_URL = WMS_BASE_URL+"reMaterial";
|
||||
public static final String REQUEST_ENTER_URL = WMS_BASE_URL+"requestEnterByTrayCodeAndEntranceId";
|
||||
public static final String CREATE_AGV_TASK_URL = AGV_BASE_URL+"agvs-task";
|
||||
public static final String OUT_MAKE_SURE=WMS_BASE_PDA_URL+"outMakeSure";
|
||||
|
||||
|
||||
public static final String WAREHOUSE_01 = "01";
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.queue.srgv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.queue.srgv.domain.WcsSrgvQueue;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 四向小车任务队列Mapper接口
|
||||
|
||||
@@ -309,7 +309,8 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
minXDistance = currentXDistance;
|
||||
bestSrgv = srgv;
|
||||
log.info("楼层相等,找到更近小车(Y轴更优) Y距离{} X距离{} srgv:{}", currentYDistance, currentXDistance, srgv);
|
||||
} else if (currentYDistance == minYDistance) {
|
||||
}
|
||||
if (currentYDistance == minYDistance) {
|
||||
// 情况2:Y轴距离相同,比较X轴距离
|
||||
if (currentXDistance < minXDistance) {
|
||||
minXDistance = currentXDistance;
|
||||
@@ -321,8 +322,6 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
|
||||
// 最终选中的小车赋值给deviceSrgv(保持原有变量名兼容)
|
||||
deviceSrgv = bestSrgv;
|
||||
|
||||
|
||||
if (deviceSrgv == null) {
|
||||
//如果未选择到小车,再找其他楼层的小车
|
||||
for (DeviceSrgv deviceSrgv1 : deviceSrgvList) {
|
||||
@@ -569,7 +568,8 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
minXDistance = currentXDistance;
|
||||
bestSrgv = srgv;
|
||||
log.info("楼层相等,找到更近小车(Y轴更优) Y距离{} X距离{} srgv:{}", currentYDistance, currentXDistance, srgv);
|
||||
} else if (currentYDistance == minYDistance) {
|
||||
}
|
||||
if (currentYDistance == minYDistance) {
|
||||
// 情况2:Y轴距离相同,比较X轴距离
|
||||
if (currentXDistance < minXDistance) {
|
||||
minXDistance = currentXDistance;
|
||||
@@ -1465,7 +1465,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
case "2":
|
||||
MydoJob mydoJobOut = mydoJobService.selectMydoJobByTaskNo(Long.valueOf(wcsSrgvQueue.getTaskNo()));
|
||||
if (mydoJobOut != null && (cargoPlaceSite.equals(currSite))) {
|
||||
log.info("1471 taskNo:[{}],currSite:[{}],cargoPlaceSite:[{}]",wcsSrgvQueue.getTaskNo(),currSite,cargoPlaceSite);
|
||||
log.info("1471 taskNo:[{}],currSite:[{}],cargoPlaceSite:[{}]", wcsSrgvQueue.getTaskNo(), currSite, cargoPlaceSite);
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
jobCallBack.setType(wcsSrgvQueue.getDefault02());
|
||||
jobCallBack.setMydojobId(mydoJobOut.getJobId());
|
||||
@@ -1473,8 +1473,11 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJobOut.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
mydoJobService.insertHistory(mydoJobOut.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJobOut.getJobId());
|
||||
// 不是线边整托线边直出的删除作业
|
||||
if (!mydoJobOut.getInOrOut().equals("22")) {
|
||||
mydoJobService.insertHistory(mydoJobOut.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJobOut.getJobId());
|
||||
}
|
||||
}
|
||||
case "7"://移库,变动库存
|
||||
MydoJob mydoJobyk = mydoJobService.selectMydoJobByTaskNo(Long.valueOf(wcsSrgvQueue.getTaskNo()));
|
||||
@@ -1513,16 +1516,16 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
{
|
||||
wcsSagvQueueMapper.deleteWcsSrgvQueueByGuid(wcsSrgvQueue.getGuid());
|
||||
}
|
||||
// 如果是空车且 任务是点到点并且目标点是“070301”
|
||||
}else if ("1".equals(taskType)&&wcsSrgvQueue.getDefault02().equals("4")&&wcsSrgvQueue.getEndSite().equals("070301")){
|
||||
// 如果是空车且 任务是点到点并且目标点是“070301”
|
||||
} else if ("1".equals(taskType) && wcsSrgvQueue.getDefault02().equals("4") && wcsSrgvQueue.getEndSite().equals("070301")) {
|
||||
String endSite = "";
|
||||
String xfType = "";
|
||||
WcsSrgvMap wcsSrgvMapq = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPickSite);
|
||||
WcsSrgvMap wcsSrgvMapf = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPlaceSite);
|
||||
// 取货点地图和放货点地图不为空
|
||||
if (wcsSrgvMapq != null && wcsSrgvMapf != null) {
|
||||
//如果是同层,终点为取货点
|
||||
endSite = cargoPickSite;
|
||||
//如果是同层,终点为取货点
|
||||
endSite = cargoPickSite;
|
||||
// 更新目标点,修改执行队列
|
||||
wcsSrgvQueue.setEndSite(endSite);
|
||||
wcsSrgvQueue.setDefault02("4");
|
||||
|
||||
@@ -106,19 +106,17 @@ public class SsjThread implements Runnable {
|
||||
void inDispatch(DeviceSsj deviceSsj) {
|
||||
//出库到位
|
||||
if (deviceSsj.getDw() == 1 && deviceSsj.getTaskNo() > 0) {
|
||||
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(deviceSsj.getTaskNo()));
|
||||
if (mydoJob != null) {
|
||||
log.info("设备:{} 位置:{} 任务号:{} 出库到位", "输送线", deviceSsj.getDeviceCode(), mydoJob.getTaskNo());
|
||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
jobCallBack.setType("2");
|
||||
jobCallBack.setMydojobId(mydoJob.getJobId());
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
if (mydoJob != null && mydoJob.getInOrOut().equals("22")) {
|
||||
// 新增agv执行队列,以及调用wms后台任务过账
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("trayCode", mydoJob.getTrayCode());
|
||||
//拉取
|
||||
AjaxResult ajaxResult = apiService.OutMakeSure(map);
|
||||
if (ajaxResult.get("code").equals("200")) {
|
||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user