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 * @author ruoyi
*/ */
@MapperScan("com.**.mapper")
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
@EnableScheduling @EnableScheduling
@EnableAsync @EnableAsync

View File

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

View File

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

View File

@@ -58,4 +58,11 @@ public interface IWcsPortService
* @return 结果 * @return 结果
*/ */
public int deleteWcsPortById(Long id); 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); 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"/> <include refid="selectWcsPortVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="selectWcsPortByPortCode" resultMap="WcsPortResult">
<include refid="selectWcsPortVo"/>
where port_code = #{portCode}
</select>
<insert id="insertWcsPort" parameterType="WcsPort" useGeneratedKeys="true" keyProperty="id"> <insert id="insertWcsPort" parameterType="WcsPort" useGeneratedKeys="true" keyProperty="id">
insert into wcs_port insert into wcs_port