zoukankan      html  css  js  c++  java
  • 开发细节

    收集重复的门店,给出异常提示

    背景:需要建立一个门店组,门店明细不允许重复,重复时收集重复的门店

    点击查看代码
    	
    public Map getByStoreList(String bufferId,List storeList) {
        Map allMap = new HashMap<>();
        if (storeList == null || storeList.isEmpty()) {
          return allMap;
        }
        /**
         * 举个例子:重复的明细行不用收集太多,收集达到200的上限就可以了.
         * storeIds.size() = 1000
         *
         * 200 只统计200以内的重复的明细行
         */
        List storeIds = new ArrayList<>(storeList);
        int fromIndex = 0;
        while (fromIndex < storeIds.size()) {
          int toIndex = Math.min(fromIndex + 200, storeIds.size());
          List ids = storeIds.subList(fromIndex, toIndex);
          List lines = lineDao.getByStoreList(bufferId, ids);
          Map storeMap = new HashMap<>();
          for (BFreshGoodsAdjStoreLine line : lines) {
            storeMap.put(line.getStoreId(), line);
          }
          allMap.putAll(storeMap);
          fromIndex = toIndex;
        }
        return allMap;
      }
    
  • 相关阅读:
    二极管常用
    金属化孔与非金属化孔
    电容~3.钽电容
    电感~2.电路分析
    交流整流之后
    电容~2.电路分许
    三极管~3常见电路
    三极管~2.电路分析
    名词解释
    硬件设计
  • 原文地址:https://www.cnblogs.com/erlangha/p/14658948.html
Copyright © 2011-2022 走看看