123
This commit is contained in:
@@ -3,12 +3,10 @@ package com.ruoyi.api.controller;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/wcs2Wms/api")
|
||||
@@ -16,6 +14,8 @@ public class Wcs2WmsController {
|
||||
|
||||
@Autowired
|
||||
private IApiService apiService;
|
||||
@Autowired
|
||||
private IWcsPortService wcsPortService;
|
||||
|
||||
/**
|
||||
* 接收出库任务
|
||||
@@ -52,5 +52,15 @@ public class Wcs2WmsController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询缓存点
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/selectWcsPort")
|
||||
@ResponseBody
|
||||
public AjaxResult selectWcsPort(@RequestBody JobParam jobParam) {
|
||||
return apiService.selectWcsPort(jobParam);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -100,6 +100,8 @@ public interface IApiService
|
||||
*/
|
||||
AjaxResult cancelMydoJob(JobParam jobParam);
|
||||
|
||||
AjaxResult selectWcsPort(JobParam jobParam);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,6 +18,8 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.PositionCodeData;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
@@ -51,6 +53,8 @@ public class ApiServiceImpl implements IApiService {
|
||||
private IAgvQueueService agvQueueService;
|
||||
@Autowired
|
||||
private IMydoJobService mydoJobService;
|
||||
@Autowired
|
||||
private IWcsPortService wcsPortService;
|
||||
|
||||
|
||||
|
||||
@@ -169,9 +173,23 @@ public class ApiServiceImpl implements IApiService {
|
||||
log.info("【AGV请求放货】任务号:{}", request.getTaskCode());
|
||||
break;
|
||||
case "end":
|
||||
|
||||
agvQueue.setStatus("7");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
log.info("【AGV任务结束】任务号:{}", request.getTaskCode());
|
||||
List<WcsPort> wcsPorts = wcsPortService.selectWcsPortList(new WcsPort());
|
||||
// 查询agvQueue中的positionCode2的值是否在wcsPorts列表中存在
|
||||
boolean isPositionValid = wcsPorts.stream()
|
||||
.anyMatch(port -> port.getPortCode().equals(agvQueue.getPositionCode2()));
|
||||
if (isPositionValid) {
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
WcsPort wcsPort = new WcsPort();
|
||||
wcsPort.setPortCode(agvQueue.getPositionCode2());
|
||||
wcsPort.setStatus("2");
|
||||
wcsPortService.updateWcsPort(wcsPort);
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
log.info("未知方法");
|
||||
@@ -311,7 +329,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
*/
|
||||
@Override
|
||||
public GenAgvSchedulingTaskResponse requestAgvQueue(AgvQueue agvQueue) {
|
||||
//todo 请求ctu
|
||||
|
||||
GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest = new GenAgvSchedulingTaskRequest();
|
||||
genAgvSchedulingTaskRequest.setReqCode(agvQueue.getReqCode());
|
||||
genAgvSchedulingTaskRequest.setTaskMode("0");
|
||||
@@ -391,4 +409,10 @@ public class ApiServiceImpl implements IApiService {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult selectWcsPort(JobParam jobParam) {
|
||||
List<WcsPort> wcsPorts = wcsPortService.selectWcsPortList(new WcsPort());
|
||||
return AjaxResult.success(wcsPorts);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user