| 
					
				 | 
			
			
				@@ -104,8 +104,9 @@ public class StockChangeServiceImpl implements StockChangeService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ThirdMerchantBizEntity thirdMerchangByCode = thirdMerchantBizService.getThirdMerchangByCode(stockChange.getThirdMerchSn()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (Objects.isNull(thirdMerchangByCode)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            log.info("第三方商户查询不到:{}",stockChange.getThirdMerchSn()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            throw new RRException("第三方商户代码不存在:"+stockChange.getThirdMerchSn()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              throw new RRException("第三方商户代码不存在:"+stockChange.getThirdMerchSn()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //商户名称 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         stockChange.setMerch(merchEntity.getMerchName()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -236,9 +237,10 @@ public class StockChangeServiceImpl implements StockChangeService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 更新库存 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<StockChangeEntity> inChangeEntities = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<StockChangeEntity> outChangeEntities = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<StockChangeEntity> stockChangeEntities = queryListByIds(ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // 审核成功才需要更新库存 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if (Constants.AuditStatus.AUDIT_SUCCESS.getType().equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            List<StockChangeEntity> stockChangeEntities = queryListByIds(ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             stockChangeEntities.stream().filter(stockChangeEntity -> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 log.info("工单号为:{}的审核状态为成功",stockChangeEntity.getId()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -267,12 +269,24 @@ public class StockChangeServiceImpl implements StockChangeService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 productStoreRelaService.updateStockNumberByOutbound(stockChangeRecordEntities); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 goodsService.updateStockNumberByOutbound(stockChangeRecordEntities); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else if (Constants.AuditStatus.AUDIT_REJECT.getType().equals(type)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ArrayList<String> crjectIdList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (StockChangeEntity stockChangeEntity : stockChangeEntities) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (!stockChangeEntity.getAudit().equals(Constants.AuditStatus.AUDIT_SUCCESS.getType())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    crjectIdList.add(stockChangeEntity.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (crjectIdList.isEmpty()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                log.info("修改出入库单审核状态时,可修改的单号为空!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                throw new RRException("选中的单号都为审核成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ids =  crjectIdList.toArray(new String[crjectIdList.size()]); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         HashMap<String, Object> map = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         map.put("auditBy", ShiroUtils.getUserEntity().getUsername()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         map.put("auditTime",new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         map.put("type",type); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         stockChangeDao.updateAuditStatus(map,ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |