|
@@ -1,10 +1,13 @@
|
|
package com.hb.proj.analysis.controller;
|
|
package com.hb.proj.analysis.controller;
|
|
|
|
|
|
|
|
+import java.util.Date;
|
|
|
|
+
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import com.hb.proj.allconfig.AccessToken;
|
|
import com.hb.proj.allconfig.AccessToken;
|
|
@@ -15,6 +18,7 @@ import com.hb.proj.model.WellMeasurePO;
|
|
import com.hb.proj.model.WellPumpPO;
|
|
import com.hb.proj.model.WellPumpPO;
|
|
import com.hb.proj.utils.RespVO;
|
|
import com.hb.proj.utils.RespVO;
|
|
import com.hb.proj.utils.RespVOBuilder;
|
|
import com.hb.proj.utils.RespVOBuilder;
|
|
|
|
+import com.hb.xframework.dao.util.PageModel;
|
|
import com.hb.xframework.util.MapUtils;
|
|
import com.hb.xframework.util.MapUtils;
|
|
|
|
|
|
import jakarta.validation.constraints.NotBlank;
|
|
import jakarta.validation.constraints.NotBlank;
|
|
@@ -30,6 +34,47 @@ public class ProduceParamController {
|
|
@Autowired
|
|
@Autowired
|
|
private RedisTemplate<String,Object> redisTemplate;
|
|
private RedisTemplate<String,Object> redisTemplate;
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 分页查询测量数据
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping("/queryMeasureParam")
|
|
|
|
+ public RespVO<PageModel<WellMeasurePO>> queryMeasureParam(@NotBlank(message="缺少井号") String wellId,
|
|
|
|
+ Date startTime,Date endTime,
|
|
|
|
+ @RequestParam(value = "currentPage", defaultValue = "1") Integer pageNum,
|
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize) {
|
|
|
|
+
|
|
|
|
+ return RespVOBuilder.ok(service.queryMeasureParam(wellId,startTime,endTime, pageNum, pageSize));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 分页查询抽油泵数据
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping("/queryPump")
|
|
|
|
+ public RespVO<PageModel<WellPumpPO>> queryPump(@NotBlank(message="缺少井号") String wellId,
|
|
|
|
+ Date startTime,Date endTime,
|
|
|
|
+ @RequestParam(value = "currentPage", defaultValue = "1") Integer pageNum,
|
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return RespVOBuilder.ok(service.queryPump(wellId,startTime,endTime, pageNum, pageSize));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 分页查询分析参数
|
|
|
|
+ */
|
|
|
|
+ @RequestMapping("/queryAnalysisParam")
|
|
|
|
+ public RespVO<PageModel<WellAnalysisParamPO>> queryAnalysisParam(@NotBlank(message="缺少井号") String wellId,
|
|
|
|
+ Date startTime,Date endTime,
|
|
|
|
+ @RequestParam(value = "currentPage", defaultValue = "1") Integer pageNum,
|
|
|
|
+ @RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ return RespVOBuilder.ok(service.queryAnalysisParam(wellId,startTime,endTime, pageNum, pageSize));
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 获得指定井的最新生成动态参数
|
|
* 获得指定井的最新生成动态参数
|
|
* @param wellId
|
|
* @param wellId
|
|
@@ -60,6 +105,11 @@ public class ProduceParamController {
|
|
service.addMeasureParam(measure);
|
|
service.addMeasureParam(measure);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
|
|
+ WellMeasurePO dbPO=service.getMeasureParam(measure.getMeasureId());
|
|
|
|
+ if(dbPO==null) {
|
|
|
|
+ return RespVOBuilder.error("记录已不存在");
|
|
|
|
+ }
|
|
|
|
+ measure.setCreateTime(dbPO.getCreateTime());
|
|
service.updateMeasureParam(measure);
|
|
service.updateMeasureParam(measure);
|
|
}
|
|
}
|
|
return RespVOBuilder.ok();
|
|
return RespVOBuilder.ok();
|
|
@@ -79,6 +129,11 @@ public class ProduceParamController {
|
|
service.addPumpParam(pump);
|
|
service.addPumpParam(pump);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
|
|
+ WellPumpPO dbPO=service.getPumpParam(pump.getPumpId());
|
|
|
|
+ if(dbPO==null) {
|
|
|
|
+ return RespVOBuilder.error("记录已不存在");
|
|
|
|
+ }
|
|
|
|
+ pump.setCreateTime(dbPO.getCreateTime());
|
|
service.updatePumpParam(pump);
|
|
service.updatePumpParam(pump);
|
|
}
|
|
}
|
|
return RespVOBuilder.ok();
|
|
return RespVOBuilder.ok();
|