| | |
| | | //单一品类 且当前循环月台为整托盘月台 |
| | | return platformJob; |
| | | }else if(!Constants.equalsInteger(materialNameSet.size(),Constants.ONE)){ |
| | | if(Constants.equalsInteger(platform.getType(),Constants.ZERO)){ |
| | | //非单一品类 |
| | | //如果单个运单包含两个及以上的品规,则需要判断是否存在单个品规超过 500 件且该品规数量占整个运单任务量的 60%及以上,则自动分配至在整托盘 月台进行月台; |
| | | BigDecimal total = platformWmsDetailList.stream().map(i->i.getIoQty()).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | |
| | | if((total.multiply(new BigDecimal("0.6")).compareTo(compareTotal)>Constants.ZERO)){ |
| | | compareTotal = total.multiply(new BigDecimal("0.6")); |
| | | } |
| | | Boolean flag = false; //是否存在大于总运单60%数量的数据 |
| | | for (String name:materialNameSet) { |
| | | BigDecimal quanlity = platformWmsDetailList.stream().filter(i->i.getMaterialName().equals(name)).map(i->i.getIoQty()).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | if(quanlity.compareTo(compareTotal)>Constants.ZERO){ |
| | | //超过规定数量 且当前月台为整托月台 |
| | | flag = true; |
| | | break; |
| | | } |
| | | } |
| | | if(Constants.equalsInteger(platform.getType(),Constants.ZERO)&&flag){ |
| | | return platformJob; |
| | | }else if(Constants.equalsInteger(platform.getType(),Constants.ONE)&&!flag){ |
| | | return platformJob; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | // //循环WMS任务 未分配至整托盘月台则直接分配到散托盘月台 |
| | | // if(Constants.equalsInteger(platform.getType(),Constants.ONE)){ |
| | | // return platformJob; |
| | | // } |
| | | }else{ |
| | | //物流车预约的任务 直接分配 散托盘月台 |
| | | if(Constants.equalsInteger(platform.getType(),Constants.TWO)){ |
| | | if(Constants.equalsInteger(platform.getType(),Constants.ONE)){ |
| | | return platformJob; |
| | | } |
| | | } |
| | |
| | | } |
| | | SystemDictData systemDictData = systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.IN_REPERTOTY_CODE); |
| | | if(Objects.nonNull(systemDictData)){ |
| | | //判断放置位置 |
| | | if(platformWmsDetailMapper.selectCount(new QueryWrapper<PlatformWmsDetail>().lambda().eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO) |
| | | Boolean flag = platformWmsDetailMapper.selectCount(new QueryWrapper<PlatformWmsDetail>().lambda().eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO) |
| | | .eq(PlatformWmsDetail::getWmsJobId,platformWmsJob.getId()) |
| | | .apply(" find_in_set(IN_REPERTOTY_CODE ,'"+systemDictData.getCode()+"')") |
| | | .eq(PlatformWmsDetail::getInRepertotyCode,"") |
| | | .isNotNull(PlatformWmsDetail::getInRepertotyCode) |
| | | ) > Constants.ZERO && Constants.equalsInteger(platform.getType(),Constants.ONE)){ |
| | | ) > Constants.ZERO; |
| | | //判断发货点信息 |
| | | if(flag && Constants.equalsInteger(platform.getType(),Constants.ONE)){ |
| | | return platformJob; |
| | | }else if(!flag && Constants.equalsInteger(platform.getType(),Constants.ZERO)){ |
| | | return platformJob; |
| | | } |
| | | } |
| | | if(Constants.equalsInteger(platform.getType(),Constants.ZERO)){ |
| | | return platformJob; |
| | | } |
| | | }else{ |
| | | //物流车预约的任务 直接分配 散托盘月台 |
| | | //物流车预约的任务 直接分配 整托盘月台 |
| | | if(Constants.equalsInteger(platform.getType(),Constants.ZERO)){ |
| | | return platformJob; |
| | | } |