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

@@ -9,10 +9,9 @@ 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

@@ -5,15 +5,15 @@ import com.ruoyi.bas.port.domain.WcsPort;
/**
* 点位管理Mapper接口
*
*
* @author ruoyi
* @date 2025-06-11
*/
public interface WcsPortMapper
public interface WcsPortMapper
{
/**
* 查询点位管理
*
*
* @param id 点位管理主键
* @return 点位管理
*/
@@ -21,7 +21,7 @@ public interface WcsPortMapper
/**
* 查询点位管理列表
*
*
* @param wcsPort 点位管理
* @return 点位管理集合
*/
@@ -29,7 +29,7 @@ public interface WcsPortMapper
/**
* 新增点位管理
*
*
* @param wcsPort 点位管理
* @return 结果
*/
@@ -37,7 +37,7 @@ public interface WcsPortMapper
/**
* 修改点位管理
*
*
* @param wcsPort 点位管理
* @return 结果
*/
@@ -45,7 +45,7 @@ public interface WcsPortMapper
/**
* 删除点位管理
*
*
* @param id 点位管理主键
* @return 结果
*/
@@ -53,9 +53,16 @@ public interface WcsPortMapper
/**
* 批量删除点位管理
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteWcsPortByIds(Long[] ids);
/**
* 根据code查询点位
* @param point
* @return
*/
WcsPort selectWcsPortByPortCode(String point);
}

View File

@@ -5,15 +5,15 @@ import com.ruoyi.bas.port.domain.WcsPort;
/**
* 点位管理Service接口
*
*
* @author ruoyi
* @date 2025-06-11
*/
public interface IWcsPortService
public interface IWcsPortService
{
/**
* 查询点位管理
*
*
* @param id 点位管理主键
* @return 点位管理
*/
@@ -21,7 +21,7 @@ public interface IWcsPortService
/**
* 查询点位管理列表
*
*
* @param wcsPort 点位管理
* @return 点位管理集合
*/
@@ -29,7 +29,7 @@ public interface IWcsPortService
/**
* 新增点位管理
*
*
* @param wcsPort 点位管理
* @return 结果
*/
@@ -37,7 +37,7 @@ public interface IWcsPortService
/**
* 修改点位管理
*
*
* @param wcsPort 点位管理
* @return 结果
*/
@@ -45,7 +45,7 @@ public interface IWcsPortService
/**
* 批量删除点位管理
*
*
* @param ids 需要删除的点位管理主键集合
* @return 结果
*/
@@ -53,9 +53,16 @@ public interface IWcsPortService
/**
* 删除点位管理信息
*
*
* @param id 点位管理主键
* @return 结果
*/
public int deleteWcsPortById(Long id);
/**
* 根据点位代码查询点位名称
* @param startPoint
* @return
*/
WcsPort selectWcsPortByPortCode(String startPoint);
}

View File

@@ -9,19 +9,19 @@ import com.ruoyi.bas.port.service.IWcsPortService;
/**
* 点位管理Service业务层处理
*
*
* @author ruoyi
* @date 2025-06-11
*/
@Service
public class WcsPortServiceImpl implements IWcsPortService
public class WcsPortServiceImpl implements IWcsPortService
{
@Autowired
private WcsPortMapper wcsPortMapper;
/**
* 查询点位管理
*
*
* @param id 点位管理主键
* @return 点位管理
*/
@@ -33,7 +33,7 @@ public class WcsPortServiceImpl implements IWcsPortService
/**
* 查询点位管理列表
*
*
* @param wcsPort 点位管理
* @return 点位管理
*/
@@ -45,7 +45,7 @@ public class WcsPortServiceImpl implements IWcsPortService
/**
* 新增点位管理
*
*
* @param wcsPort 点位管理
* @return 结果
*/
@@ -57,7 +57,7 @@ public class WcsPortServiceImpl implements IWcsPortService
/**
* 修改点位管理
*
*
* @param wcsPort 点位管理
* @return 结果
*/
@@ -69,7 +69,7 @@ public class WcsPortServiceImpl implements IWcsPortService
/**
* 批量删除点位管理
*
*
* @param ids 需要删除的点位管理主键
* @return 结果
*/
@@ -81,7 +81,7 @@ public class WcsPortServiceImpl implements IWcsPortService
/**
* 删除点位管理信息
*
*
* @param id 点位管理主键
* @return 结果
*/
@@ -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

@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.bas.port.mapper.WcsPortMapper">
<resultMap type="WcsPort" id="WcsPortResult">
<result property="id" column="id" />
<result property="portCode" column="port_code" />
@@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWcsPortList" parameterType="WcsPort" resultMap="WcsPortResult">
<include refid="selectWcsPortVo"/>
<where>
<where>
<if test="portCode != null and portCode != ''"> and port_code = #{portCode}</if>
<if test="portName != null and portName != ''"> and port_name like concat('%', #{portName}, '%')</if>
<if test="portType != null and portType != ''"> and port_type = #{portType}</if>
@@ -33,11 +33,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectWcsPortById" parameterType="Long" resultMap="WcsPortResult">
<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
@@ -83,9 +87,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteWcsPortByIds" parameterType="String">
delete from wcs_port where id in
delete from wcs_port where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
</mapper>