Merge branch 'liweidong'

liweidong
liweidong-hj 1 month ago
commit 8ade9f1231
  1. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/mapper/StationMapper.java
  2. 5
      blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/mapper/StationMapper.xml
  3. 7
      blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/IStationService.java
  4. 3
      blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/ITaskExecuteRecordService.java
  5. 23
      blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/PipelineServiceImpl.java
  6. 5
      blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/StationServiceImpl.java
  7. 3
      blade-service/blade-desk/src/main/java/org/springblade/desk/logistics/service/impl/TaskExecuteRecordServiceImpl.java

@ -10,4 +10,6 @@ import java.util.List;
public interface StationMapper extends BaseMapper<Station> { public interface StationMapper extends BaseMapper<Station> {
List<Station> selectByWcId(@Param("wcId") Long wcId); List<Station> selectByWcId(@Param("wcId") Long wcId);
Station selectByStationPosition(@Param("StationPosition") String freeStationCode);
} }

@ -9,4 +9,9 @@
select id, station_name, station_code, station_status, status, create_user, create_time, create_dept, update_user, update_time, is_deleted, remark, station_position, wc_id select id, station_name, station_code, station_status, status, create_user, create_time, create_dept, update_user, update_time, is_deleted, remark, station_position, wc_id
from LM_STATION where IS_DELETED = 0 and WC_ID = #{wcId} from LM_STATION where IS_DELETED = 0 and WC_ID = #{wcId}
</select> </select>
<select id="selectByStationPosition" resultType="org.springblade.desk.logistics.pojo.entity.Station">
select id, station_name, station_code, station_status, status, create_user, create_time, create_dept, update_user, update_time, is_deleted, remark, station_position, wc_id
from LM_STATION where IS_DELETED = 0 and STATION_POSITION = #{StationPosition}
</select>
</mapper> </mapper>

@ -45,4 +45,11 @@ public interface IStationService extends BaseService<Station> {
* @return * @return
*/ */
List<Station> selectByWcId(Long wcId); List<Station> selectByWcId(Long wcId);
/**
* 根据站点编码 查询站点信息
* @param freeStationCode
* @return
*/
Station getByStationPosition(String freeStationCode);
} }

@ -57,9 +57,10 @@ public interface ITaskExecuteRecordService extends BaseService<TaskExecuteRecord
* @param startPos 开始位置 * @param startPos 开始位置
* @param endPos 结束位置 * @param endPos 结束位置
* @param type 位置类型00AGV 05CTU * @param type 位置类型00AGV 05CTU
* @param virtualShelvesCode 虚拟货架号
* @return * @return
*/ */
AgvSchedulingTaskVO genAgvSchedulingTask(String taskTyp, String startPos, String endPos, String type); AgvSchedulingTaskVO genAgvSchedulingTask(String taskTyp, String startPos, String endPos, String type,String virtualShelvesCode);
/** /**
* agv ctu 小车调用成功 做记录 * agv ctu 小车调用成功 做记录

@ -155,7 +155,8 @@ public class PipelineServiceImpl implements IPipelineService {
taskType, taskType,
startPos, startPos,
endPos, endPos,
type type,
virtualShelves.getVirtualShelvesCode()
); );
if (null == agvSchedulingTaskVO || !"0".equals(agvSchedulingTaskVO.getCode())) { if (null == agvSchedulingTaskVO || !"0".equals(agvSchedulingTaskVO.getCode())) {
log.error("调用AGV调度失败"); log.error("调用AGV调度失败");
@ -217,11 +218,17 @@ public class PipelineServiceImpl implements IPipelineService {
if (null != wcId) { if (null != wcId) {
// 尝试找空闲站点 // 尝试找空闲站点
String freeStationCode = findFreeStationCode(wcId); Station station = findFreeStationCode(wcId);
if (null != freeStationCode) { if (null != station) {
log.info("找到空闲站点:{},将物料箱送往该站点", freeStationCode); log.info("找到空闲站点:{},将物料箱送往该站点", station.getStationCode());
// TODO 调用AGV小车送往空闲站点
return true; String stationPosition = station.getStationPosition();
String taskType = agvTaskTypeUtil.getTaskType(Integer.parseInt(stationPosition));
boolean agvSchedulingTask = genAgvSchedulingTask
(taskType, Station.PICKUP_CONVEYOR_LINE, station.getStationCode(), AgvConstant.EQUIPMENT_TYPE_AGV, task);
return agvSchedulingTask;
} }
} }
@ -233,7 +240,7 @@ public class PipelineServiceImpl implements IPipelineService {
/** /**
* 查找空闲站点编码 * 查找空闲站点编码
*/ */
private String findFreeStationCode(Long wcId) { private Station findFreeStationCode(Long wcId) {
List<Station> stationList = stationService.selectByWcId(wcId); List<Station> stationList = stationService.selectByWcId(wcId);
if (CollectionUtils.isEmpty(stationList)) { if (CollectionUtils.isEmpty(stationList)) {
return null; return null;
@ -248,7 +255,7 @@ public class PipelineServiceImpl implements IPipelineService {
return null; return null;
} }
return freeStations.get(0).getStationCode(); return freeStations.get(0);
} }
/** /**

@ -52,4 +52,9 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, Station>
public List<Station> selectByWcId(Long wcId) { public List<Station> selectByWcId(Long wcId) {
return stationMapper.selectByWcId(wcId); return stationMapper.selectByWcId(wcId);
} }
@Override
public Station getByStationPosition(String freeStationCode) {
return stationMapper.selectByStationPosition(freeStationCode);
}
} }

@ -156,7 +156,7 @@ public class TaskExecuteRecordServiceImpl extends BaseServiceImpl<TaskExecuteRec
} }
@Override @Override
public AgvSchedulingTaskVO genAgvSchedulingTask(String taskTyp, String startPos, String endPos, String type) { public AgvSchedulingTaskVO genAgvSchedulingTask(String taskTyp, String startPos, String endPos, String type,String virtualShelvesCode) {
// 接口地址 // 接口地址
String url = "http://172.22.252.10:8181/rcms/services/rest/hikRpcService/genAgvSchedulingTask"; String url = "http://172.22.252.10:8181/rcms/services/rest/hikRpcService/genAgvSchedulingTask";
@ -170,6 +170,7 @@ public class TaskExecuteRecordServiceImpl extends BaseServiceImpl<TaskExecuteRec
requestBody.put("reqCode", reqCode); requestBody.put("reqCode", reqCode);
requestBody.put("taskCode", taskCode); requestBody.put("taskCode", taskCode);
requestBody.put("taskTyp", taskTyp); requestBody.put("taskTyp", taskTyp);
requestBody.put("podCode", virtualShelvesCode);
// 构建位置路径列表 // 构建位置路径列表
List<Map<String, String>> positionCodePath = new ArrayList<>(); List<Map<String, String>> positionCodePath = new ArrayList<>();

Loading…
Cancel
Save