no message

main
HUOJIN\92525 2025-02-16 22:09:47 +08:00
parent bf4d837e39
commit 4b2577b715
8 changed files with 37 additions and 16 deletions

View File

@ -46,7 +46,7 @@ public interface InventoryRepository extends JpaRepository<Inventory, Long>, Jpa
"and (:pointId is null or inv.point.id=:pointId)" + "and (:pointId is null or inv.point.id=:pointId)" +
"and (:areaName is null or inv.point.area.name=:areaName)" + "and (:areaName is null or inv.point.area.name=:areaName)" +
"and (:deptId is null or inv.dept.id=:deptId)" + "and (:deptId is null or inv.dept.id=:deptId)" +
"order by inv.itemKey.propC1 ") "order by inv.createTime ")
List<Inventory> queryInventory(Long stockId, Long itemId, Long pointId, String areaName, Long deptId); List<Inventory> queryInventory(Long stockId, Long itemId, Long pointId, String areaName, Long deptId);
/** /**

View File

@ -59,7 +59,7 @@ public interface TaskRepository extends JpaRepository<Task, Long>, JpaSpecificat
* *
* @param pickId ID * @param pickId ID
*/ */
@Query("from Task t where t.pickDetail.pick.id =:pickId and t.planQty - t.moveQty>0 ") @Query("from Task t where t.pickDetail.pick.id =:pickId and t.planQty - t.moveQty>=0 and t.moveQty!=0 ")
List<Task> findByPickAllTask(Long pickId); List<Task> findByPickAllTask(Long pickId);
/** /**

View File

@ -119,6 +119,14 @@ public interface AgvTaskService {
*/ */
Boolean findByEndSlotCode(String endSlotCode, String type, String jobType); Boolean findByEndSlotCode(String endSlotCode, String type, String jobType);
/**
*
* @param endSlotCode
* @param type
* @param jobType
* @return
*/
Boolean findByCcEndSlotCode(String endSlotCode, String type, String jobType);
/** /**
* *

View File

@ -154,6 +154,18 @@ public class AgvTaskServiceImpl implements AgvTaskService {
return agvTaskList.isEmpty(); return agvTaskList.isEmpty();
} }
@Override
public Boolean findByCcEndSlotCode(String endSlotCode, String type, String jobType) {
String hql = " from AgvTask agv " +
" where agv.endSlotCode='" + endSlotCode + "' " +
" and agv.type='" + type + "' " +
" and agv.jobType='" + jobType + "' " +
" and agv.status in ('ATCALL','UP_CONTAINER') ";
Query query = entityMapper.createQuery(hql);
List<AgvTask> agvTaskList = query.getResultList();
return agvTaskList.isEmpty();
}
@Override @Override
public List<AgvTask> findOpenByAgvTask() { public List<AgvTask> findOpenByAgvTask() {
return agvTaskRepository.findOpenByAgvTask(); return agvTaskRepository.findOpenByAgvTask();

View File

@ -353,7 +353,7 @@ public class KMReServiceImpl implements KMReService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void missionStateCallback(AgvTask agvTask, String status, String containerCode,String currentPosition) { public void missionStateCallback(AgvTask agvTask, String status, String containerCode, String currentPosition) {
Stock stock = stockService.findByCode(containerCode); Stock stock = stockService.findByCode(containerCode);
//顶升的是起点;其它终点; //顶升的是起点;其它终点;
Point point; Point point;
@ -373,7 +373,7 @@ public class KMReServiceImpl implements KMReService {
handleForkDownContainer(agvTask, stock);//容器放下 handleForkDownContainer(agvTask, stock);//容器放下
break; break;
case "ARRIVED": case "ARRIVED":
handleARContainer(agvTask,stock, currentPosition);//容器到达 handleARContainer(agvTask, stock, currentPosition);//容器到达
break; break;
case "COMPLETED": case "COMPLETED":
handleComContainer(agvTask, stock, point);//搬运任务完成 handleComContainer(agvTask, stock, point);//搬运任务完成
@ -471,8 +471,8 @@ public class KMReServiceImpl implements KMReService {
this.updateAgvTaskStatus(agvTask, stock, BizStatus.FINISH); this.updateAgvTaskStatus(agvTask, stock, BizStatus.FINISH);
} }
private void handleARContainer(AgvTask agvTask,Stock stock, String currentPosition) { private void handleARContainer(AgvTask agvTask, Stock stock, String currentPosition) {
if("FX001".equals(currentPosition)){ if ("FX001".equals(currentPosition)) {
//更新状态 //更新状态
this.updateAgvTaskStatus(agvTask, stock, BizStatus.ARRIVED); this.updateAgvTaskStatus(agvTask, stock, BizStatus.ARRIVED);
} }

View File

@ -576,11 +576,6 @@ public class TaskServiceImpl implements TaskService {
inventory.setQueuedQty(inventory.getQueuedQty() - moveQty); inventory.setQueuedQty(inventory.getQueuedQty() - moveQty);
inventory.setQuantity(inventory.getQuantity() - moveQty); inventory.setQuantity(inventory.getQuantity() - moveQty);
inventoryService.update(inventory); inventoryService.update(inventory);
//删除库存
if (inventory.getQuantity() <= 0) {
inventoryService.deleteAll(new Long[]{inventory.getId()});
}
} }
//生成新库存 //生成新库存

View File

@ -79,7 +79,7 @@ public class pickTask {
*/ */
public void callJlTask() { public void callJlTask() {
/*查询拣货完成完成的出库单*/ /*查询拣货完成完成的出库单*/
List<String> statuses = Arrays.asList(BizStatus.PICKUP,BizStatus.PICK_ALL); List<String> statuses = Arrays.asList(BizStatus.PICKUP, BizStatus.PICK_ALL);
List<Pick> pickList = pickService.findByPickStatus(statuses, true); List<Pick> pickList = pickService.findByPickStatus(statuses, true);
if (pickList.isEmpty()) { if (pickList.isEmpty()) {
throw new BadRequestException("无拣货完成的出库单或出库单未叫料!"); throw new BadRequestException("无拣货完成的出库单或出库单未叫料!");
@ -100,10 +100,14 @@ public class pickTask {
for (AgvTask agvTask : agvTaskList) { for (AgvTask agvTask : agvTaskList) {
if (BizStatus.PICK.equals(agvTask.getType())) { if (BizStatus.PICK.equals(agvTask.getType())) {
//目标点没有托盘继续下发下一个任务 //目标点没有托盘继续下发下一个任务
Stock stock= stockService.findByPointCode(agvTask.getEndSlotCode()); String endSlotCode = agvTask.getEndSlotCode();
if(stock==null){ Stock stock = stockService.findByPointCode(endSlotCode);
if (stock == null) {
boolean isTaskFound = agvTaskService.findByCcEndSlotCode(endSlotCode, BizStatus.PICK, "FORKLIFT_MOVE");
if (isTaskFound) {
kmReService.sendAgvTask(agvTask, kmReService.sendAgvTaskCcJson(agvTask)); kmReService.sendAgvTask(agvTask, kmReService.sendAgvTaskCcJson(agvTask));
} }
}
} else { } else {
kmReService.sendAgvTask(agvTask, kmReService.sendAgvTaskHjJson(agvTask)); kmReService.sendAgvTask(agvTask, kmReService.sendAgvTaskHjJson(agvTask));
} }

View File

@ -22,7 +22,9 @@ public class EladminSystemApplicationTests {
} }
public static void main(String[] args) { public static void main(String[] args) {
String str = "17213913-0002";
String aa=str.substring(0,11);
System.out.println(aa);
} }
static Set bb(Set set1, Set set2) { static Set bb(Set set1, Set set2) {