|
@@ -3,12 +3,16 @@ package com.hb.proj.data.controller;
|
|
|
import java.util.Date;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.redis.core.HashOperations;
|
|
|
+import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import com.hb.proj.base.service.DeviceService;
|
|
|
import com.hb.proj.data.service.LiquidService;
|
|
|
+import com.hb.proj.model.DevicePO;
|
|
|
import com.hb.proj.model.LiquidPO;
|
|
|
import com.hb.proj.model.LiquidVO;
|
|
|
import com.hb.proj.utils.RespVO;
|
|
@@ -26,6 +30,34 @@ public class LiquidController {
|
|
|
@Autowired
|
|
|
private LiquidService service;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DeviceService devService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private RedisTemplate<String,Object> redisTemplate;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得动液面设备基础信息
|
|
|
+ * @param wellId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("/getLiquidDevBase")
|
|
|
+ public RespVO<Object> getLiquidDevBase(@NotBlank(message="井号不能为空") String wellId){
|
|
|
+ return RespVOBuilder.ok(devService.getByWell(wellId, DevicePO.LIQUID));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取动液面设备状态(手动远程操作时)
|
|
|
+ * @param serial
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("/loadLiquidStatus")
|
|
|
+ public RespVO<Object> loadLiquidStatus(@NotBlank(message="设备编号不能为空") String serial){
|
|
|
+ HashOperations<String, String, Object> ops=redisTemplate.opsForHash();
|
|
|
+ return RespVOBuilder.ok(ops.entries("liquid_"+serial));
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 分页查询指定井的动液面数据
|