Browse Source

动液面压差,折算深度相关计算代码整理

chenwen 1 year ago
parent
commit
41b6f06baa

+ 11 - 0
src/main/java/com/hb/proj/gather/model/LiquidVO.java

@@ -31,4 +31,15 @@ public class LiquidVO {
 	 * 折算动液面深度 单位 m
 	 */
 	private Double liquidDepthConvert;
+	
+	
+	/**
+	 * 静液面深度 单位 m=最后一次静液测试时的静液面深度=最后一次静液测试时的校正液面深度
+	 */
+	private Double liquidDepthStatic;
+	
+	/**
+	 * 折算静液面深度 单位 m=最后一次静液测试时的折算静液面深度=最后一次静液测试时的折算动液面深度
+	 */
+	private Double liquidDepthStaticConvert;
 }

+ 5 - 6
src/main/java/com/hb/proj/gather/process/LiquidCalculator.java

@@ -3,7 +3,6 @@ package com.hb.proj.gather.process;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.hb.proj.gather.model.LiquidVO;
 import com.hb.proj.gather.model.WellMeasurePO;
 
 
@@ -50,16 +49,16 @@ public class LiquidCalculator {
 	}
 	
 	/**
-	 * 计算深度压差
+	 * 计算深度压差=折算动液面深度-折算静液面深度=折算动液面深度-最后一次静液测算时的折算液面深度
 	 * @param cvtLiquidDepth 折算动液面深度
-	 * @param lastStaticLiquid 静液面数据对象
+	 * @param cvtLiquidStaticDepth 折算静液面深度
 	 * @return
 	 */
-	public static Double calcDepthDiff(Double cvtLiquidDepth,LiquidVO lastStaticLiquid) {
-		if(cvtLiquidDepth==null || lastStaticLiquid==null || lastStaticLiquid.getLiquidDepthConvert()==null) {
+	public static Double calcDepthDiff(Double cvtLiquidDepth,Double cvtLiquidStaticDepth) {
+		if(cvtLiquidDepth==null || cvtLiquidStaticDepth==null) {
 			return null;
 		}
-		return cvtLiquidDepth.doubleValue()-lastStaticLiquid.getLiquidDepthConvert().doubleValue();
+		return cvtLiquidDepth.doubleValue()-cvtLiquidStaticDepth.doubleValue();
 	}
 	
 	/**

+ 9 - 9
src/main/java/com/hb/proj/gather/rep/GatherDataRepService.java

@@ -146,11 +146,11 @@ public class GatherDataRepService {
 		LiquidVO lastSSLiquid=getLastLiquidCalcViaSoundSpeed(liquidPO.getWellId());
 		LiquidVO lastStaticLiquid=getLastLiquidStaticCalc(liquidPO.getWellId());
 		
-		//校正音速
+		//校正音速=最新一次手动音速法计算时设置的音速
 		Double	val=lastSSLiquid!=null && lastSSLiquid.getSoundSpeed()!=null?lastSSLiquid.getSoundSpeed():null;
 		args.add(val);
 				
-		//校正液面深度
+		//校正液面深度=设备采集深度*最新手动音速法计算时设置的k系数
 		val=liquidPO.getLiquidDepthDev()*(lastSSLiquid!=null && lastSSLiquid.getSoundSpeedFactor()!=null?lastSSLiquid.getSoundSpeedFactor():1);
 		args.add(val);
 		
@@ -161,19 +161,19 @@ public class GatherDataRepService {
 		val=LiquidCalculator.calcConvertLiquidDepth(val, liquidPO.getCasingPressDev(), lastMeasure);
 		args.add(val);
 		
-		//深度压差
-		val=LiquidCalculator.calcDepthDiff(val, lastStaticLiquid);
+		//深度压差=折算动液面深度-折算静液面深度=折算动液面深度-最近一次静液测算折算静液面深度=折算动液面深度-最近一次静液测算时折算动液面深度
+		val=LiquidCalculator.calcDepthDiff(val, lastStaticLiquid!=null?lastStaticLiquid.getLiquidDepthStaticConvert():null);
 		args.add(val);
 		
 		//流动压差
 		val=LiquidCalculator.calcFlowPreeDiff(val, lastMeasure);
 		args.add(val);
 		
-		//静液面深度
-		args.add(lastStaticLiquid!=null?lastStaticLiquid.getLiquidDepth():null);
+		//静液面深度=最近一次静液测算时的静液面深度=测算时的校正液面深度;
+		args.add(lastStaticLiquid!=null?lastStaticLiquid.getLiquidDepthStatic():null);
 		
-		//折算静深度
-		args.add(lastStaticLiquid!=null?lastStaticLiquid.getLiquidDepthConvert():null);
+		//折算静深度=最近一次静液测算的值=测算时的折算液面深度
+		args.add(lastStaticLiquid!=null?lastStaticLiquid.getLiquidDepthStaticConvert():null);
 		
 		dao.exeUpdate(sql, args.toArray());
 	}
@@ -212,7 +212,7 @@ public class GatherDataRepService {
 	 */
 	private LiquidVO getLastLiquidStaticCalc(String wellId) {
 		String sql="""
-				select liquid_depth,liquid_depth_convert 
+				select liquid_depth,liquid_depth_convert,liquid_depth_static,liquid_depth_static_convert 
 				from tzl_gather_data_liquid 
 				where well_id=? and test_time<now() and static_calc_if=true
 				order by test_time desc limit 1