| | |
| | | @ManagerAuth(memo = "生成拣货单") |
| | | public synchronized R pakout2(@RequestBody List<LocDto> locDtos) throws InterruptedException { |
| | | int[][] is = new int[locDtos.size()][2]; |
| | | List<String> matnrs=new ArrayList<>(); |
| | | for (int i = 0; i < locDtos.size(); i++) { |
| | | LocDto locDto = locDtos.get(locDtos.size() - 1 - i); |
| | | if (locDto.getLocNo() == null || locDto.getManu().equals("立库")) { |
| | |
| | | } |
| | | is[i][1] = locDtos.size() - 1 - i; |
| | | } |
| | | List<LocDto> locDtos1=new ArrayList<>(); |
| | | for (int[] i : is) { |
| | | if (i[0] == 1) { |
| | | if (!matnrs.contains(locDtos.get(i[1]).getMatnr())){ |
| | | matnrs.add(locDtos.get(i[1]).getMatnr()); |
| | | } |
| | | locDtos1.add(locDtos.get(i[1])); |
| | | locDtos.remove(i[1]); |
| | | } |
| | | } |
| | | for (String matnr:matnrs){ |
| | | Double a = 0.0; |
| | | int b = 0; |
| | | for (int i = 0; i < locDtos1.size(); i++){ |
| | | if (locDtos1.get(i).getMatnr().equals(matnr)){ |
| | | if (a.equals(0)){ |
| | | b=i; |
| | | } |
| | | a=a+locDtos1.get(i).getAnfme(); |
| | | } |
| | | } |
| | | LocDto locDto = locDtos1.get(b); |
| | | locDto.setLocNo("立库"); |
| | | locDto.setAnfme(a); |
| | | locDtos.add(locDto); |
| | | } |
| | | if (Cools.isEmpty(locDtos)) { |
| | | return R.error("平库参数为空,没有生成拣货单"); |
| | | } |