PTL配送逻辑

This commit is contained in:
liuhanqing
2025-08-13 09:45:33 +08:00
parent 321afdf63c
commit 71246ea670
6 changed files with 83 additions and 37 deletions

View File

@@ -12,7 +12,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
*
* @author ruoyi
*/
@MapperScan("com.**.mapper")
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
@EnableScheduling
@EnableAsync

View File

@@ -21,6 +21,8 @@ import com.ruoyi.api.domain.wcs2wms.MydoJob;
import com.ruoyi.api.service.IApiService;
import com.ruoyi.bas.fluent.domain.BasFluentFrame;
import com.ruoyi.bas.fluent.service.IBasFluentFrameService;
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.core.text.Convert;
import com.ruoyi.device.agv.domain.AgvQueue;
@@ -54,6 +56,8 @@ public class ApiServiceImpl implements IApiService {
private IAgvQueueService agvQueueService;
@Autowired
private IBasFluentFrameService fluentFrameService;
@Autowired
private IWcsPortService wcsPortService;
/**
* 请求入库
@@ -148,13 +152,32 @@ public class ApiServiceImpl implements IApiService {
*/
@Override
public AjaxResult receiveAgvMoveJob(Map<String, String> param) {
String startPoint = param.get("startPoint");
String endPoint = param.get("endPoint");
//todo 待调试
AgvQueue agvQueue = createAgvQueue(param.get("startPoint"),param.get("endPoint"), param.get("wmsTrayCode"), param.get("taskNo"), "3");
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = requestAgvQueue(agvQueue);
if (genAgvSchedulingTaskResponse.getCode() == 0) {
return AjaxResult.success();
WcsPort startWcsPort = wcsPortService.selectWcsPortByPortCode(startPoint);
WcsPort endWcsPort = wcsPortService.selectWcsPortByPortCode(endPoint);
if (ObjUtil.isNull(startWcsPort)){
return AjaxResult.error("起始点不存在");
}
return AjaxResult.error(genAgvSchedulingTaskResponse.getMessage());
if (ObjUtil.isNull(endWcsPort)){
return AjaxResult.error("结束点不存在");
}
if ("1".equals(startWcsPort.getStatus()) && "0".equals(endWcsPort.getStatus())){
AgvQueue agvQueue = createAgvQueue(startWcsPort.getSpare2(),endWcsPort.getSpare2(), param.get("wmsTrayCode"), param.get("taskNo"), "3");
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = requestAgvQueue(agvQueue);
if (genAgvSchedulingTaskResponse.getCode() == 0) {
return AjaxResult.success();
}
return AjaxResult.error(genAgvSchedulingTaskResponse.getMessage());
}
if ("0".equals(startWcsPort.getStatus())){
return AjaxResult.error("起始点位无容器");
}
if ("1".equals(endWcsPort.getStatus())){
return AjaxResult.error("目标点位有容器");
}
return AjaxResult.error();
}
/**
@@ -329,7 +352,8 @@ public class ApiServiceImpl implements IApiService {
case "takeCompleted":
//ctu取货完成
HashMap<String, Object> takeCompletedParam = new HashMap<>();
takeCompletedParam.put("lljCode",agvQueue.getPositionCode1());
takeCompletedParam.put("portCode",agvQueue.getPositionCode1());
takeCompletedParam.put("wmsType",agvQueue.getWmsTaskType());
takeCompleted(takeCompletedParam);
break;
default:

View File

@@ -58,4 +58,11 @@ public interface WcsPortMapper
* @return 结果
*/
public int deleteWcsPortByIds(Long[] ids);
/**
* 根据code查询点位
* @param point
* @return
*/
WcsPort selectWcsPortByPortCode(String point);
}

View File

@@ -58,4 +58,11 @@ public interface IWcsPortService
* @return 结果
*/
public int deleteWcsPortById(Long id);
/**
* 根据点位代码查询点位名称
* @param startPoint
* @return
*/
WcsPort selectWcsPortByPortCode(String startPoint);
}

View File

@@ -90,4 +90,9 @@ public class WcsPortServiceImpl implements IWcsPortService
{
return wcsPortMapper.deleteWcsPortById(id);
}
@Override
public WcsPort selectWcsPortByPortCode(String point) {
return wcsPortMapper.selectWcsPortByPortCode(point);
}
}

View File

@@ -38,6 +38,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectWcsPortVo"/>
where id = #{id}
</select>
<select id="selectWcsPortByPortCode" resultMap="WcsPortResult">
<include refid="selectWcsPortVo"/>
where port_code = #{portCode}
</select>
<insert id="insertWcsPort" parameterType="WcsPort" useGeneratedKeys="true" keyProperty="id">
insert into wcs_port