| 
					
				 | 
			
			
				@@ -1,6 +1,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 package org.jeecg.modules.documents.shippingDetails.service.impl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.core.metadata.IPage; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.common.exception.JeecgBootException; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -361,13 +362,66 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * 发运明细推送(查询主表) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-     * @param id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param ids 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public PurchasePreDeliverVo getPurchasePreDeliverVo(List<String> id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public List<PurchasePreDeliverVo> getPurchasePreDeliverVo(List<String> ids) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<PurchasePreDeliverVo> purchasePreDeliverVos=syShippingDetailsMapper.getPurchasePreDeliverVo(ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<PurchasePreDeliverDetailVo> deliverDetailVos=syShippingDetailsMapper.getPurchasePreDeliverDetailVo(ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<PurchasePreDeliverDetailSizeVo> deliverDetailSizeVos=syShippingDetailsMapper.getPurchasePreDeliverDetailSizeVo(ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Map<String,List<PurchasePreDeliverDetailVo>> deliverDetailVoMaps=new HashMap<>();//预约发货单子表map集合 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Map<String,List<PurchasePreDeliverDetailSizeVo>> deliverDetailSizeVoMaps=new HashMap<>();//预约发货单子表尺码map集合 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        deliverDetailVos.forEach(p->{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (deliverDetailVoMaps.containsKey(p.getSyShippingId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                deliverDetailVoMaps.get(p.getSyShippingId()).add(p); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<PurchasePreDeliverDetailVo> deliverDetailVos1=new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                deliverDetailVos1.add(p); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                deliverDetailVoMaps.put(p.getSyShippingId(),deliverDetailVos1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        deliverDetailSizeVos.forEach(p->{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (deliverDetailSizeVoMaps.containsKey(p.getSyShippingDetailGroupId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                deliverDetailSizeVoMaps.get(p.getSyShippingDetailGroupId()).add(p); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<PurchasePreDeliverDetailSizeVo> deliverDetailVos1=new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                deliverDetailVos1.add(p); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                deliverDetailSizeVoMaps.put(p.getSyShippingDetailGroupId(),deliverDetailVos1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        deliverDetailVos.forEach(p->{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            p.setPurchasePreDeliverDetailSizeList(deliverDetailSizeVoMaps.get(p.getSyShippingDetailGroupId())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        purchasePreDeliverVos.forEach(p->{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            p.setPurchasePreDeliverDetailList(deliverDetailVoMaps.get(p.getSyShippingId())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return purchasePreDeliverVos; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return syShippingDetailsMapper.getPurchasePreDeliverVo(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public void getStrings(List<String> idsList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<SyShippingDetails> syShippingDetails=syShippingDetailsMapper.getStrings(idsList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Map<String,List<String>> stringListMap=new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        syShippingDetails.forEach(p->{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (stringListMap.containsKey(p.getPushSrmState())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                stringListMap.get(p.getPushSrmState()).add(p.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<String> ids=new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                ids.add(p.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                stringListMap.put(p.getPushSrmState(),ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        for (String string : stringListMap.keySet()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (string==null||string.equals("0")||string.equals("2")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<String> ids=stringListMap.get(string); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                UpdateWrapper updateWrapper=new UpdateWrapper(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                updateWrapper.set("push_srm_state","0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                updateWrapper.set("push_srm_message",""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                updateWrapper.in("id",ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                syShippingDetailsMapper.update(null,updateWrapper); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -389,7 +443,9 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public List<PurchasePreDeliverDetailVo> getPurchasePreDeliverDetailVo(List<String> shippingDetailsId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<PurchasePreDeliverDetailVo> deliverDetailVos=syShippingDetailsMapper.getPurchasePreDeliverDetailVo(shippingDetailsId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         deliverDetailVos.forEach(p->{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            List<PurchasePreDeliverDetailSizeVo> deliverDetailSizeVos=syShippingDetailsMapper.getPurchasePreDeliverDetailSizeVo(p.getSyShippingDetailGroupId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ArrayList arrayList=new ArrayList(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            arrayList.add(p.getSyShippingDetailGroupId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<PurchasePreDeliverDetailSizeVo> deliverDetailSizeVos=syShippingDetailsMapper.getPurchasePreDeliverDetailSizeVo(arrayList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             p.setPurchasePreDeliverDetailSizeList(deliverDetailSizeVos); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return deliverDetailVos; 
			 |