|  | @@ -1978,16 +1978,16 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 | 
	
		
			
				|  |  |  					List<FabricMoOrderRK> findRkList = rowInList.stream().filter(e -> omOrder.getMODetailsID().indexOf(e.getMODetailsID().toString()) > -1).collect(Collectors.toList());
 | 
	
		
			
				|  |  |  					omOrder.setFabricMoOrderRKList(findRkList);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -					Double iMoneyCk = 0.0;
 | 
	
		
			
				|  |  | -					for (FabricMoOrderCK item : findCkList) {
 | 
	
		
			
				|  |  | -						iMoneyCk += item.getIMoney();
 | 
	
		
			
				|  |  | -					}
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  					for (FabricMoOrderRK fabricMoOrderRK : findRkList) {
 | 
	
		
			
				|  |  | +						// 查询同一委外行出库总费用
 | 
	
		
			
				|  |  | +						Double iMoneyCk = findCkList.stream().filter(e->e.getMODetailsID().equals(fabricMoOrderRK.getMODetailsID())).mapToDouble(FabricMoOrderCK::getIMoney).sum();
 | 
	
		
			
				|  |  | +						// 查询同一委外行入库总数量
 | 
	
		
			
				|  |  | +						Double iSumRk = findRkList.stream().filter(e->e.getMODetailsID().equals(fabricMoOrderRK.getMODetailsID())).mapToDouble(FabricMoOrderRK::getIQuantityIn).sum();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  						fabricMoOrderRK.setISumBillQuantityN(DoubleOperation.sub(fabricMoOrderRK.getIQuantityIn(), fabricMoOrderRK.getISumBillQuantity()));
 | 
	
		
			
				|  |  |  						fabricMoOrderRK.setISQuantityN(DoubleOperation.sub(fabricMoOrderRK.getIQuantityIn(), fabricMoOrderRK.getISQuantity()).doubleValue());
 | 
	
		
			
				|  |  | -						if (omOrder.getIQuantityIn() != 0) {
 | 
	
		
			
				|  |  | -							Double curIMoneyCk = iMoneyCk * fabricMoOrderRK.getIQuantityIn() / omOrder.getIQuantityIn();
 | 
	
		
			
				|  |  | +						if (iSumRk != 0) {
 | 
	
		
			
				|  |  | +							Double curIMoneyCk = iMoneyCk * fabricMoOrderRK.getIQuantityIn() / iSumRk;
 | 
	
		
			
				|  |  |  							fabricMoOrderRK.setIPrice(DoubleOperation.div(DoubleOperation.add(fabricMoOrderRK.getIProcessFee(), curIMoneyCk), fabricMoOrderRK.getIQuantityIn(), 4));
 | 
	
		
			
				|  |  |  						}
 | 
	
		
			
				|  |  |  					}
 | 
	
	
		
			
				|  | @@ -2053,7 +2053,7 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 | 
	
		
			
				|  |  |  			// 每行设置金额
 | 
	
		
			
				|  |  |  			for (FabricCommonIn item : commonInList){
 | 
	
		
			
				|  |  |  				Integer detailId = item.getMODetailsID();
 | 
	
		
			
				|  |  | -				List<Map<String,Object>> findInOutList = inOutDetailList.stream().filter(e->e.get("MODetailsID").toString().equals(detailId)).collect(Collectors.toList());
 | 
	
		
			
				|  |  | +				List<Map<String,Object>> findInOutList = inOutDetailList.stream().filter(e->oConvertUtils.getInt(e.get("MODetailsID")).equals(detailId)).collect(Collectors.toList());
 | 
	
		
			
				|  |  |  				if (findInOutList.size() == 0){
 | 
	
		
			
				|  |  |  					continue;
 | 
	
		
			
				|  |  |  				}
 | 
	
	
		
			
				|  | @@ -2063,11 +2063,15 @@ public class FabricLossServiceImpl extends ServiceImpl<FabricLossMapper, FabricL
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  				for (FabricMoOrderCK ckItem : outList){
 | 
	
		
			
				|  |  |  					if (ckItem.getMODetailsID().equals(item.getMODetailsID())){
 | 
	
		
			
				|  |  | +						// 取出库物料平均价格
 | 
	
		
			
				|  |  | +						Double dMoney=0.0,dSum=0.0;
 | 
	
		
			
				|  |  |  						for (FabricCommonIn inItem : inList){
 | 
	
		
			
				|  |  |  							if (inItem.getInvId().equalsIgnoreCase(ckItem.getInvOutId())){
 | 
	
		
			
				|  |  | -								iOutTotalMoney = DoubleOperation.add(iOutTotalMoney, DoubleOperation.mul(inItem.getIPrice(),ckItem.getIQuantityOut(),2));
 | 
	
		
			
				|  |  | +								dMoney = DoubleOperation.add(dMoney,DoubleOperation.mul(inItem.getIPrice(),inItem.getIQuantity()));
 | 
	
		
			
				|  |  | +								dSum = DoubleOperation.add(dSum, inItem.getIQuantity());
 | 
	
		
			
				|  |  |  							}
 | 
	
		
			
				|  |  |  						}
 | 
	
		
			
				|  |  | +						iOutTotalMoney = DoubleOperation.add(iOutTotalMoney, DoubleOperation.mul(DoubleOperation.div(dMoney, dSum, 4),ckItem.getIQuantityOut(),2));
 | 
	
		
			
				|  |  |  					}
 | 
	
		
			
				|  |  |  				}
 | 
	
		
			
				|  |  |  				// 入库单价
 |