|  |  |  | 
|---|
|  |  |  | throw new CoolException("表格内容不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<PurchaseTemplate> resultList = result.getList(); | 
|---|
|  |  |  | Map<String, List<PurchaseTemplate>> listMap = resultList.stream().collect(Collectors.groupingBy(PurchaseTemplate::getPoCode)); | 
|---|
|  |  |  | Map<String, List<PurchaseTemplate>> listMap = resultList.stream().collect(Collectors.groupingBy(item -> | 
|---|
|  |  |  | !Objects.isNull(item.getPoCode()) ? item.getPoCode() : SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_ORDER_PO_CODE, null) | 
|---|
|  |  |  | )); | 
|---|
|  |  |  | for (String key : listMap.keySet()) { | 
|---|
|  |  |  | List<PurchaseTemplate> list = listMap.get(key); | 
|---|
|  |  |  | Purchase serviceOne = purchaseService.getOne(new LambdaQueryWrapper<Purchase>().eq(Purchase::getCode, key)); | 
|---|
|  |  |  | 
|---|
|  |  |  | throw new CoolException("供应商:" + template.getSplrName() + "不存在!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | throw new CoolException("供应商不能为空!!"); | 
|---|
|  |  |  | throw new CoolException("供应商编码不能为空!!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!this.save(item)) { | 
|---|
|  |  |  | throw new CoolException("单据明细保存失败!!"); | 
|---|