|
@@ -14,6 +14,7 @@ import com.ruoyi.inventory.domain.dto.TakeStockDTO;
|
|
|
import com.ruoyi.inventory.domain.dto.TbAssetInventoryDTO;
|
|
|
import com.ruoyi.inventory.mapper.TbInventoryDetailMapper;
|
|
|
import com.ruoyi.utils.IDUtil;
|
|
|
+import com.ruoyi.utils.RecursionUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.ruoyi.inventory.mapper.TbAssetInventoryMapper;
|
|
@@ -91,7 +92,7 @@ public class TbAssetInventoryServiceImpl implements ITbAssetInventoryService
|
|
|
epcList.add(tagInfo.getEpc());
|
|
|
}
|
|
|
|
|
|
- List<String> locations = getNumberWithChildren(location);
|
|
|
+ List<String> locations = new RecursionUtil().getNumberWithChildren(locationMapper, location);
|
|
|
|
|
|
List<String> rfidList = informationMapper.selectNumberByLocations(locations);
|
|
|
|
|
@@ -165,30 +166,6 @@ public class TbAssetInventoryServiceImpl implements ITbAssetInventoryService
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
- * 递归函数
|
|
|
- */
|
|
|
- public List<String> getNumberWithChildren(String number) {
|
|
|
- Set<String> result = new HashSet<>();
|
|
|
- Set<String> visited = new HashSet<>();
|
|
|
-
|
|
|
- processNumberWithChildren(number, result, visited);
|
|
|
-
|
|
|
- return new ArrayList<>(result);
|
|
|
- }
|
|
|
-
|
|
|
- private void processNumberWithChildren(String number, Set<String> result, Set<String> visited) {
|
|
|
- if (!visited.contains(number)) {
|
|
|
- visited.add(number);
|
|
|
- List<String> children = locationMapper.selectNumberByFather(number);
|
|
|
-
|
|
|
-
|
|
|
- for (String child : children) {
|
|
|
- result.add(child);
|
|
|
- processNumberWithChildren(child, result, visited);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
private int takeStock(String orderNumber, List<String> list, Long result){
|
|
|
TbAssetInventory inventory = tbAssetInventoryMapper.selectTbAssetInventoryByNumber(orderNumber);
|