package com.ruoyi.taiye.service.impl; import com.ruoyi.ams.business.IBusinessService; import com.ruoyi.ams.config.domain.dto.AgvCallDTO; import com.ruoyi.ams.config.domain.dto.AgvCallItemDTO; import com.ruoyi.ams.config.domain.dto.LotattDTO; import com.ruoyi.ams.task.domain.WcsTask; import com.ruoyi.ams.task.mapper.WcsTaskMapper; import com.ruoyi.base.constant.Constant; import com.ruoyi.base.domain.BaseLocationInfo; import com.ruoyi.base.service.IBaseLocationInfoService; import com.ruoyi.taiye.service.ProcessService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; @Service @Slf4j public class ProcessServiceImpl implements ProcessService { @Autowired WcsTaskMapper wcsTaskMapper; private final String SMID = ""; @Autowired private IBusinessService iBusinessService; @Autowired private IBaseLocationInfoService iBaseLocationInfoService; @Override public void createPackingMachineUnloadingTask(String taskType, Integer from) { WcsTask wcsTask = new WcsTask(); wcsTask.setLocationTo(SMID); List tasking = wcsTaskMapper.getTasking(wcsTask); if (!tasking.isEmpty()){ return; } // BaseLocationInfo fromLocation = iBaseLocationInfoService.selectBaseLocationInfoByIdOrNo(SMID, Constant.WAREHOUSE_ID); // fromLocation.setIsEmpty("N"); // iBaseLocationInfoService.updateBaseLocationInfo(fromLocation); AgvCallDTO agvCallDTO = new AgvCallDTO(); agvCallDTO.setLocationFrom(from+""); agvCallDTO.setLocationTo(SMID); iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.valueOf(taskType).getValue(),agvCallDTO); } @Override public void createPackingMachineUpEmptyPallets(String taskType, Integer to) { WcsTask wcsTask = new WcsTask(); wcsTask.setLocationTo(to+""); List tasking = wcsTaskMapper.getTasking(wcsTask); if (!tasking.isEmpty()){ return; } List agvCallItemDTOList = new ArrayList<>(); AgvCallItemDTO agvCallItemDTO = new AgvCallItemDTO(); agvCallItemDTO.setSku("EMPTY_TRAY"); // 空托 agvCallItemDTO.setQty(1.0); agvCallItemDTOList.add(agvCallItemDTO); AgvCallDTO agvCallDTO = new AgvCallDTO(); agvCallDTO.setLocationTo(to+""); agvCallDTO.setAgvCallItemDTOList(agvCallItemDTOList); iBusinessService.agvCall(Constant.FLOW_CONFIG_ID.valueOf(taskType).getValue(),agvCallDTO); } }