|  |  |  | @ -149,6 +149,18 @@ public class RelCodeBatchService extends ServiceImpl<RelCodeBatchMapper, RelCode | 
			
		
	
		
			
				
					|  |  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |  |     @Transactional(rollbackFor = Exception.class) | 
			
		
	
		
			
				
					|  |  |  |  |     public void add(RelCodeBatchRequest relCodeBatchRequest) { | 
			
		
	
		
			
				
					|  |  |  |  |         String productCode = relCodeBatchRequest.getProductCode(); | 
			
		
	
		
			
				
					|  |  |  |  |         String subTypeNo = relCodeBatchRequest.getSubTypeNo(); | 
			
		
	
		
			
				
					|  |  |  |  |         String batchNo = relCodeBatchRequest.getBatchNo(); | 
			
		
	
		
			
				
					|  |  |  |  |         //如果不存在就添加
 | 
			
		
	
		
			
				
					|  |  |  |  |         List<RelCodeBatch> list = this.list(new LambdaQueryWrapper<RelCodeBatch>() | 
			
		
	
		
			
				
					|  |  |  |  |                 .eq(RelCodeBatch::getProductCode, productCode) | 
			
		
	
		
			
				
					|  |  |  |  |                 .eq(RelCodeBatch::getSubTypeNo, subTypeNo) | 
			
		
	
		
			
				
					|  |  |  |  |                 .eq(RelCodeBatch::getBatchNo, batchNo)) | 
			
		
	
		
			
				
					|  |  |  |  |                 ; | 
			
		
	
		
			
				
					|  |  |  |  |         if (CollUtil.isNotEmpty(list)){ | 
			
		
	
		
			
				
					|  |  |  |  |             throw new JsonException( "层级编码:【"+productCode + "】;类型编码:【" + subTypeNo + "】;批次号:【"+batchNo + "】已存在!"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         List<RelCodeDetailRequest> detailList = relCodeBatchRequest.getDetailList(); | 
			
		
	
		
			
				
					|  |  |  |  |         if(CollUtil.isEmpty(detailList)){ | 
			
		
	
		
			
				
					|  |  |  |  |             throw new JsonException("关联明细不能为空!"); | 
			
		
	
	
		
			
				
					|  |  |  | 
 |