| 
					
				 | 
			
			
				@@ -24,6 +24,7 @@ import java.math.BigDecimal; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.text.ParseException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.text.SimpleDateFormat; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.ArrayList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.Calendar; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.Date; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -52,9 +53,9 @@ public class FullSetRateController extends JeecgController<FullSetRate, IFullSet 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if(oConvertUtils.isNotEmpty(fullSetRate.getSubcontractOrderNo())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             queryWrapper.like("a.cCode",fullSetRate.getSubcontractOrderNo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-       // if(oConvertUtils.isNotEmpty(fullSetRate.getBeginDate())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            queryWrapper.between("b.dPreDate","2022-09-21","2022-09-21");//fullSetRate.getBeginDate(),fullSetRate.getEndDate() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-       // } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(oConvertUtils.isNotEmpty(fullSetRate.getBeginDate())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            queryWrapper.between("b.dPreDate",fullSetRate.getBeginDate(),fullSetRate.getEndDate());//"2022-07-01","2022-07-30" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //        if(oConvertUtils.isNotEmpty(fullSetRate.getSection())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //            queryWrapper.like("a.cCode",fullSetRate.getSection()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 //        } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -82,7 +83,7 @@ public class FullSetRateController extends JeecgController<FullSetRate, IFullSet 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //查询销售订单子表预发货日期信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             QueryWrapper<FullSetRate> queryWrapper1 = new QueryWrapper<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             queryWrapper1.eq("ID",li.getID()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            queryWrapper1.between("dPreDate","2022-09-21","2022-09-21"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            queryWrapper1.between("dPreDate",fullSetRate.getBeginDate(),fullSetRate.getEndDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             List<FullSetRate> querySomain = fullSetRateService.querySOMain(queryWrapper1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //循环子表 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -121,12 +122,38 @@ public class FullSetRateController extends JeecgController<FullSetRate, IFullSet 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             li.setCumulativeDelayedDeliveryQty(cumulativeDelayedDeliveryQty); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //最早出库日期赋值,最晚出库日期赋值 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             List<FullSetRate> dateTimeList = fullSetRateService.querySalesIssueDate(moDeilsIDList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            li.setEarliestIssueDate(dateTimeList.get(dateTimeList.size()-1).getDeliveryDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            li.setLatestIssueDate(dateTimeList.get(0).getDeliveryDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(dateTimeList.size() !=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                li.setEarliestIssueDate(dateTimeList.get(dateTimeList.size()-1).getDeliveryDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                li.setLatestIssueDate(dateTimeList.get(0).getDeliveryDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                li.setEarliestIssueDate(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                li.setLatestIssueDate(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //出库率赋值(销售订单累计出库数量/销售订单数量) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(oConvertUtils.isEmpty(li.getCumulativeIssueQuantity())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                li.setCumulativeIssueQuantity(BigDecimal.ZERO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             BigDecimal deliveryRate = li.getCumulativeIssueQuantity().divide(li.getSalesOrderQuantity(),2,BigDecimal.ROUND_FLOOR); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             li.setDeliveryRate(deliveryRate); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //设置区间率 =销售出库数量/订单数量 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(oConvertUtils.isNotEmpty(fullSetRate.getSection())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Calendar ca = Calendar.getInstance(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                ca.setTime(sf.parse(li.getDeliveryDate())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                ca.add(Calendar.DATE,Integer.parseInt(fullSetRate.getSection())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String time = sf.format(ca.getTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String num = fullSetRateService.queryIntervalNumber(moDeilsIDList,li.getDeliveryDate(),time); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if(oConvertUtils.isEmpty(num)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    num = "0"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                BigDecimal intervalDeliveryRate = new BigDecimal(num).divide(li.getSalesOrderQuantity(), 2, BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                li.setIntervalDeliveryRate(intervalDeliveryRate); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                li.setIntervalDeliveryRate(BigDecimal.ZERO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             li.setSoIDsID(moDeilsIDList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -137,15 +164,16 @@ public class FullSetRateController extends JeecgController<FullSetRate, IFullSet 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             for(FullSetRateList rate :list){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 //获取最小齐套率且赋值 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 List<FullSetRateSubInfo> setRate = fullSetRateService.queryOMMOmainSubInfo(rate.getMODetailsID()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                rate.setSetRate(setRate.get(0).getSetRate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if(oConvertUtils.isEmpty(setRate.get(0).getSetRate())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    rate.setSetRate(BigDecimal.ZERO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     avg = avg.add(BigDecimal.ZERO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    avg = avg.add(new BigDecimal(setRate.get(0).getSetRate())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    rate.setSetRate(setRate.get(0).getSetRate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    avg = avg.add(setRate.get(0).getSetRate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 i++; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            BigDecimal rate = avg.divide(new BigDecimal(i),2,BigDecimal.ROUND_HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            BigDecimal rate = avg.divide(new BigDecimal(i),2,BigDecimal.ROUND_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             li.setFullSetRate(rate.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |