| 
					
				 | 
			
			
				@@ -7,6 +7,7 @@ import org.apache.shiro.SecurityUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.common.exception.JeecgBootException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.common.system.vo.LoginUser; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.modules.documents.orderData.entity.SyOrderDataItem; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.jeecg.modules.documents.orderData.mapper.SyOrderDataItemMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.modules.documents.seclarationElements.entity.SyDeclarationElements; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.modules.documents.seclarationElements.entity.SyDeclarationElementsItem; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.jeecg.modules.documents.seclarationElements.mapper.SyDeclarationElementsItemMapper; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -67,6 +68,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	private SyDeclarationElementsMapper syDeclarationElementsMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	private SyOrderDataItemMapper syOrderDataItemMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	private ISenYuDataSourceOne senYuDataSourceOne; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	private ISenYuDataSourceTwo senYuDataSourceTwo; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -594,11 +597,53 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			BigDecimal total2=new BigDecimal("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			BigDecimal total3=new BigDecimal("0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			String ids=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			for (SyPackingListFabricItem item :main.getSyPackingListFabricItem()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				SyShippingDetailsItem syShippingDetailsItem=syShippingDetailsItemMapper.selectById(item.getSyShippingDetailsItemId());//获取物料分类和其他数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				//物料分类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				if(syShippingDetailsItem!=null){//不为null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					SyOrderDataItem syOrderDataItem=syOrderDataItemMapper.selectById(syShippingDetailsItem.getSyOrderDataItemId());//获取单位 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					item.setInventoryCcode(syShippingDetailsItem.getInventoryCcode());//物料分类 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					item.setPrice(syShippingDetailsItem.getSalesUnitPrice());//价格 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					if(syOrderDataItem!=null){//不为null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						if((item.getInventoryCcode().indexOf("03")!=-1&&!item.getInventoryCcode().equals("0399")) || 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+								(item.getInventoryCcode().indexOf("04")!=-1&&!item.getInventoryCcode().equals("0499"))){//面料 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+							//米数计算公式 净重/(门幅/100)/(克重/1000) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+							if(item.getNetWeight()!=null&&item.getGramWeight()!=null&&item.getWidth()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+								BigDecimal netWeight=item.getNetWeight();//净重 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+								BigDecimal gramWeight=new BigDecimal(item.getGramWeight());//克重 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+								BigDecimal width=new BigDecimal(item.getWidth());//门幅 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+								BigDecimal meter=netWeight.multiply(gramWeight).multiply(width).divide(new BigDecimal("100000"));//米数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+								item.setMeter(meter);//米数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+							} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+							if(item!=null&&item.getMasterMetering().equals("KG")){//KG 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+								item.setTotalPrice(item.getNetWeight().multiply(item.getPrice()));//净重*单价 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+							}else if(item!=null&&item.getMasterMetering().equals("M")){//M 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+								item.setTotalPrice(item.getMeter().multiply(item.getPrice()));//米数*单价 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+							}else if(item.getActualDeclaredQuantity()!=null){//其他 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+								item.setTotalPrice(item.getActualDeclaredQuantity().multiply(item.getPrice()));//米数*单价 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+							}else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+								throw new JeecgBootException("请给单位不为KG或者M的面辅料填上实际报关数量"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+							} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						}else{////辅料 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+							if(item.getActualDeclaredQuantity()!=null){//其他 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+								item.setTotalPrice(item.getActualDeclaredQuantity().multiply(item.getPrice()));//米数*单价 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+							}else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+								throw new JeecgBootException("请给单位不为KG或者M的面辅料填上实际报关数量"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+							} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+						} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				//单位换算 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				total3=total3.add(item.getActualDeclaredQuantity()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				ids+=item.getSyShippingDetailsItemId()+",";//获取出运明细子表id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			if(!ids.equals("")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				ids=ids.substring(0,ids.length()-1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				QueryWrapper queryWrapper=new QueryWrapper(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				queryWrapper.in("id", Arrays.asList(ids.split(","))); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -688,7 +733,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 					"and cInvCCode not like '03%'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 					"and cInvCCode not like '04%'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 					"and cInvCCode not like '19%'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-					"and cCusCode='T020001' and\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+					"and cCusCode='0001' and\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 						" f.AutoID in (" + maps.get(account).toString().substring(1, maps.get(account).toString().length() - 1) + ") "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				List<Map<String, Object>> list = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				if (account.equals("903")) { 
			 |