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 * @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

@@ -5,15 +5,15 @@ import com.ruoyi.bas.port.domain.WcsPort;
/** /**
* 点位管理Mapper接口 * 点位管理Mapper接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-06-11 * @date 2025-06-11
*/ */
public interface WcsPortMapper public interface WcsPortMapper
{ {
/** /**
* 查询点位管理 * 查询点位管理
* *
* @param id 点位管理主键 * @param id 点位管理主键
* @return 点位管理 * @return 点位管理
*/ */
@@ -21,7 +21,7 @@ public interface WcsPortMapper
/** /**
* 查询点位管理列表 * 查询点位管理列表
* *
* @param wcsPort 点位管理 * @param wcsPort 点位管理
* @return 点位管理集合 * @return 点位管理集合
*/ */
@@ -29,7 +29,7 @@ public interface WcsPortMapper
/** /**
* 新增点位管理 * 新增点位管理
* *
* @param wcsPort 点位管理 * @param wcsPort 点位管理
* @return 结果 * @return 结果
*/ */
@@ -37,7 +37,7 @@ public interface WcsPortMapper
/** /**
* 修改点位管理 * 修改点位管理
* *
* @param wcsPort 点位管理 * @param wcsPort 点位管理
* @return 结果 * @return 结果
*/ */
@@ -45,7 +45,7 @@ public interface WcsPortMapper
/** /**
* 删除点位管理 * 删除点位管理
* *
* @param id 点位管理主键 * @param id 点位管理主键
* @return 结果 * @return 结果
*/ */
@@ -53,9 +53,16 @@ public interface WcsPortMapper
/** /**
* 批量删除点位管理 * 批量删除点位管理
* *
* @param ids 需要删除的数据主键集合 * @param ids 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteWcsPortByIds(Long[] ids); 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接口 * 点位管理Service接口
* *
* @author ruoyi * @author ruoyi
* @date 2025-06-11 * @date 2025-06-11
*/ */
public interface IWcsPortService public interface IWcsPortService
{ {
/** /**
* 查询点位管理 * 查询点位管理
* *
* @param id 点位管理主键 * @param id 点位管理主键
* @return 点位管理 * @return 点位管理
*/ */
@@ -21,7 +21,7 @@ public interface IWcsPortService
/** /**
* 查询点位管理列表 * 查询点位管理列表
* *
* @param wcsPort 点位管理 * @param wcsPort 点位管理
* @return 点位管理集合 * @return 点位管理集合
*/ */
@@ -29,7 +29,7 @@ public interface IWcsPortService
/** /**
* 新增点位管理 * 新增点位管理
* *
* @param wcsPort 点位管理 * @param wcsPort 点位管理
* @return 结果 * @return 结果
*/ */
@@ -37,7 +37,7 @@ public interface IWcsPortService
/** /**
* 修改点位管理 * 修改点位管理
* *
* @param wcsPort 点位管理 * @param wcsPort 点位管理
* @return 结果 * @return 结果
*/ */
@@ -45,7 +45,7 @@ public interface IWcsPortService
/** /**
* 批量删除点位管理 * 批量删除点位管理
* *
* @param ids 需要删除的点位管理主键集合 * @param ids 需要删除的点位管理主键集合
* @return 结果 * @return 结果
*/ */
@@ -53,9 +53,16 @@ public interface IWcsPortService
/** /**
* 删除点位管理信息 * 删除点位管理信息
* *
* @param id 点位管理主键 * @param id 点位管理主键
* @return 结果 * @return 结果
*/ */
public int deleteWcsPortById(Long id); 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业务层处理 * 点位管理Service业务层处理
* *
* @author ruoyi * @author ruoyi
* @date 2025-06-11 * @date 2025-06-11
*/ */
@Service @Service
public class WcsPortServiceImpl implements IWcsPortService public class WcsPortServiceImpl implements IWcsPortService
{ {
@Autowired @Autowired
private WcsPortMapper wcsPortMapper; private WcsPortMapper wcsPortMapper;
/** /**
* 查询点位管理 * 查询点位管理
* *
* @param id 点位管理主键 * @param id 点位管理主键
* @return 点位管理 * @return 点位管理
*/ */
@@ -33,7 +33,7 @@ public class WcsPortServiceImpl implements IWcsPortService
/** /**
* 查询点位管理列表 * 查询点位管理列表
* *
* @param wcsPort 点位管理 * @param wcsPort 点位管理
* @return 点位管理 * @return 点位管理
*/ */
@@ -45,7 +45,7 @@ public class WcsPortServiceImpl implements IWcsPortService
/** /**
* 新增点位管理 * 新增点位管理
* *
* @param wcsPort 点位管理 * @param wcsPort 点位管理
* @return 结果 * @return 结果
*/ */
@@ -57,7 +57,7 @@ public class WcsPortServiceImpl implements IWcsPortService
/** /**
* 修改点位管理 * 修改点位管理
* *
* @param wcsPort 点位管理 * @param wcsPort 点位管理
* @return 结果 * @return 结果
*/ */
@@ -69,7 +69,7 @@ public class WcsPortServiceImpl implements IWcsPortService
/** /**
* 批量删除点位管理 * 批量删除点位管理
* *
* @param ids 需要删除的点位管理主键 * @param ids 需要删除的点位管理主键
* @return 结果 * @return 结果
*/ */
@@ -81,7 +81,7 @@ public class WcsPortServiceImpl implements IWcsPortService
/** /**
* 删除点位管理信息 * 删除点位管理信息
* *
* @param id 点位管理主键 * @param id 点位管理主键
* @return 结果 * @return 结果
*/ */
@@ -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

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