| 
					
				 | 
			
			
				@@ -11,8 +11,10 @@ import org.jeecg.common.exception.JeecgBootException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.common.system.util.JwtUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.common.system.vo.LoginUser; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.config.InterfaceConnUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.jeecg.modules.documents.orderData.entity.SyOrderData; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.modules.documents.orderData.entity.SyOrderDataItem; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.modules.documents.orderData.mapper.SyOrderDataItemMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.jeecg.modules.documents.orderData.mapper.SyOrderDataMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.modules.documents.seclarationElements.entity.SyDeclarationElements; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.modules.documents.seclarationElements.entity.SyDeclarationElementsItem; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.modules.documents.seclarationElements.mapper.SyDeclarationElementsItemMapper; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -87,6 +89,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	private SyDeclarationElementsMapper syDeclarationElementsMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	private SyOrderDataMapper syOrderDataMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	private SyOrderDataItemMapper syOrderDataItemMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	private ISenYuDataSourceOne senYuDataSourceOne; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -107,6 +111,33 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		return  roleName.getRealname(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	public Map<String,String> orderNumber(List<String> ids){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		QueryWrapper queryWrapper=new QueryWrapper(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		queryWrapper.in("id",ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		List<SyOrderData> orderDatas=syOrderDataMapper.selectList(queryWrapper); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		Map<String,String> maps=new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	 	/*maps.put("正常销售订单",""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		maps.put("手工同步订单","");*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		for (SyOrderData orderData : orderDatas){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			if(orderData.getDelFlag().equals("0")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				String name=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				if(maps.containsKey("正常销售订单")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					name=maps.get("正常销售订单"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				name+=orderData.getOrderNumber(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				maps.put("正常销售订单",name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			}else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				String name=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				if(maps.containsKey("手工同步订单")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					name=maps.get("手工同步订单"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				name+=orderData.getOrderNumber(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				maps.put("手工同步订单",name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		return maps; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	 * 通过参照出运明细添加数据  添加方式1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	 * @param syPackingListFabric 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -163,7 +194,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			entity.setFactoryUnitPrice(detailsItem.getFactoryUnitPrice());//工厂单价 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			if(entity.getMasterMetering()==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				throw new JeecgBootException("没有单位的物料"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				throw new JeecgBootException("未获取到销售订单的单位"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			if(entity.getMasterMetering().equals("KG")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				updateQuantity(entity.getNetWeight(),entity.getSyShippingDetailsItemId(),entity.getMasterMetering()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -713,6 +744,14 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				SimpleDateFormat sf = new SimpleDateFormat("yyMMddHHmmssSSS"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				String dateNo ="ML"+sf.format(System.currentTimeMillis());//获取单据号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				SyPackingListFabric syPackingListFabric =maps.get(str); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				List<String> ids=new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				for (SyPackingListFabricItem item : syPackingListFabric.getSyPackingListFabricItem()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					ids.add(item.getSyOrderDataId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				Map<String,String> maps2=orderNumber(ids); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				if(maps2.size()==2){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					throw new JeecgBootException("手工匹配订单不能跟普通销售订单混合在一起,手工匹配订单是:"+maps.get("手工同步订单")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				//syPackingListFabric.setGarmentFactory(str);//成衣工厂 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				syPackingListFabric.setDocumentNo(dateNo);//单据号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				syPackingListFabric.setStatus("0");//状态 
			 |