| 
					
				 | 
			
			
				@@ -1359,7 +1359,7 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public int updateDetailsDirect(Map<String, Object> mapValue) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public synchronized int updateDetailsDirect(Map<String, Object> mapValue) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         List<BigDecimal> orderIds = (List<BigDecimal>) mapValue.get("orderList"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         BigDecimal priceValue = DataChange.dataToBigDecimal(mapValue.get("detailAmount")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if(priceValue.intValue() < 0){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1388,32 +1388,39 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             bmstruckDetailsOrderMapper.updateAsomPriceIdByOrderId(orderId,priceId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             saleLogUtil.logOrder(orderId,"直接修改单价",userName,SaleLogUtil.UPDATE); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				              
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            List<Map<String,Object>> weightTaskResultIdList = bmstruckDetailsOrderMapper.getSteelWeightTaskResultId(orderId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            for (Map<String, Object> map : weightTaskResultIdList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                BigDecimal weightTaskResultId = DataChange.dataToBigDecimal(map.get("weightTaskResultId")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                BigDecimal netWeightIsNull = bmstruckDetailsOrderMapper.getNetWeight(weightTaskResultId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if (netWeightIsNull == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            List<Map<String,Object>> batchIdList = bmstruckDetailsOrderMapper.getWeightBatchIds(orderId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            for (Map<String, Object> map : batchIdList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                BigDecimal weightBatchId = DataChange.dataToBigDecimal(map.get("weightBatchId")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                BigDecimal netWeight = DataChange.dataToBigDecimal(map.get("netWeight")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (netWeight == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     System.out.println("没有计量实绩,不生成结算数据:" + orderId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                BigDecimal  detailsAmountOld = generateTruckFeesForDirect(priceValue, weightTaskResultId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String formula_string = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (orderType.intValue() >= 1 && orderType.intValue() <= 3) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    formula_string = bmstruckFormulaService.getTruckFormula(new BigDecimal(10)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    formula_string = formula_string.replace("运输单价",priceValue.toString()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            .replace("物资净重",netWeight.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                String s = toSufExpr(formula_string); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                BigDecimal  detailsAmountOld = calSufExpr(s); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Double amount = detailsAmountOld.doubleValue(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 BigDecimal detailsAmount = new BigDecimal(amount).setScale(2,RoundingMode.HALF_UP); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if(bmstruckDetailsOrderMapper.getIsHaveDetailsOrder(weightTaskResultId) > 0 ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    Map<String,Object> temp =new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    temp.put("orderId",orderId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    temp.put("weightTaskResultId",weightTaskResultId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    temp.put("priceValue",priceValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    temp.put("detailAmount",detailsAmount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    temp.put("detailRemark",detailRemark); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    temp.put("url",url); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    temp.put("userId",userId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    result +=bmstruckDetailsOrderMapper.updateTruckDetails(temp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if(bmstruckDetailsOrderMapper.getIsHaveDetailsOrderByBatch(weightBatchId) > 0 ){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    BigDecimal detailsId = bmstruckDetailsOrderMapper.getDetailsIdByBatchId(weightBatchId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    BmstruckDetailsOrder bmstruckDetailsOrder = bmstruckDetailsOrderMapper.selectByPrimaryKey(detailsId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    bmstruckDetailsOrder.setDetailsId(detailsId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    bmstruckDetailsOrder.setDetailsAmount(detailsAmount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                   result += bmstruckDetailsOrderMapper.updateByPrimaryKeySelective(bmstruckDetailsOrder); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     BmstruckDetailsOrder bmstruckDetailsOrder = new BmstruckDetailsOrder(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1422,7 +1429,7 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     BigDecimal detailsId = selectMaxId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     String detailsNo = noUtil.setResultNo("QYXD", detailsId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     bmstruckDetailsOrder.setDetailsId(detailsId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    bmstruckDetailsOrder.setWeightTaskResultId(weightTaskResultId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    bmstruckDetailsOrder.setWeightBatchId(weightBatchId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     bmstruckDetailsOrder.setOrderId(orderId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     bmstruckDetailsOrder.setDetailsNo(detailsNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     bmstruckDetailsOrder.setDetailsAmount(detailsAmount); 
			 |