|
@@ -4,8 +4,12 @@ import cn.hutool.core.convert.Convert;
|
|
|
import com.ruoyi.common.constant.ElasticConstants;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.framework.config.ElasticSearchClient;
|
|
|
+import com.ruoyi.system.domain.DeviceBo;
|
|
|
import com.ruoyi.system.domain.IllegalInfo;
|
|
|
import com.ruoyi.system.domain.SyncPost;
|
|
|
+import com.ruoyi.system.service.IAisDatabase;
|
|
|
+import com.ruoyi.system.service.IHeiYanService;
|
|
|
+import com.ruoyi.system.service.ISo2Service;
|
|
|
import com.ruoyi.web.service.IGasCommonService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -38,6 +42,12 @@ public class GasCommonController {
|
|
|
private IGasCommonService gasCommonService;
|
|
|
@Autowired
|
|
|
private ElasticSearchClient client;
|
|
|
+ @Autowired
|
|
|
+ private ISo2Service so2Service;
|
|
|
+ @Autowired
|
|
|
+ private IAisDatabase aisDatabase;
|
|
|
+ @Autowired
|
|
|
+ private IHeiYanService heiYanService;
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('system:gas:sync')")
|
|
|
@PostMapping("/sync")
|
|
@@ -87,4 +97,86 @@ public class GasCommonController {
|
|
|
return AjaxResult.success(Convert.toList(IllegalInfo.class, stringObjectMap.get("pageList")));
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/queryDeviceList")
|
|
|
+ @ApiOperation("获取所有设备数据")
|
|
|
+ public AjaxResult queryDeviceList(@RequestParam(required = false) String monitor) {
|
|
|
+ List<DeviceBo> njsanq = new ArrayList<>();
|
|
|
+ List<DeviceBo> njsiq = new ArrayList<>();
|
|
|
+ List<DeviceBo> ry = new ArrayList<>();
|
|
|
+ List<DeviceBo> tz = new ArrayList<>();
|
|
|
+ List<DeviceBo> jy = new ArrayList<>();
|
|
|
+ List<DeviceBo> st = new ArrayList<>();
|
|
|
+ Map<String, Object> data = new HashMap<>();
|
|
|
+ List<DeviceBo> so2 = so2Service.queryDeviceList(monitor);
|
|
|
+ List<DeviceBo> ais = aisDatabase.queryDeviceList(monitor);
|
|
|
+ List<DeviceBo> heiyan = heiYanService.queryDeviceList(monitor);
|
|
|
+ for (DeviceBo deviceBo : so2) {
|
|
|
+ deviceBo.setOrgName(orgMap.get(deviceBo.getMonitorName()));
|
|
|
+ switch (deviceBo.getMonitorName()) {
|
|
|
+ case "南京三桥":
|
|
|
+ njsanq.add(deviceBo);
|
|
|
+ case "南京四桥":
|
|
|
+ njsiq.add(deviceBo);
|
|
|
+ case "润扬大桥":
|
|
|
+ ry.add(deviceBo);
|
|
|
+ case "泰州大桥":
|
|
|
+ tz.add(deviceBo);
|
|
|
+ case "江阴大桥":
|
|
|
+ jy.add(deviceBo);
|
|
|
+ case "苏通大桥":
|
|
|
+ st.add(deviceBo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (DeviceBo deviceBo : ais) {
|
|
|
+ deviceBo.setOrgName(orgMap.get(deviceBo.getMonitorName()));
|
|
|
+ switch (deviceBo.getMonitorName()) {
|
|
|
+ case "南京三桥":
|
|
|
+ njsanq.add(deviceBo);
|
|
|
+ case "南京四桥":
|
|
|
+ njsiq.add(deviceBo);
|
|
|
+ case "润扬大桥":
|
|
|
+ ry.add(deviceBo);
|
|
|
+ case "泰州大桥":
|
|
|
+ tz.add(deviceBo);
|
|
|
+ case "江阴大桥":
|
|
|
+ jy.add(deviceBo);
|
|
|
+ case "苏通大桥":
|
|
|
+ st.add(deviceBo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (DeviceBo deviceBo : heiyan) {
|
|
|
+ switch (deviceBo.getMonitorName()) {
|
|
|
+ case "南京三桥":
|
|
|
+ njsanq.add(deviceBo);
|
|
|
+ case "南京四桥":
|
|
|
+ njsiq.add(deviceBo);
|
|
|
+ case "润扬大桥":
|
|
|
+ ry.add(deviceBo);
|
|
|
+ case "泰州大桥":
|
|
|
+ tz.add(deviceBo);
|
|
|
+ case "江阴大桥":
|
|
|
+ jy.add(deviceBo);
|
|
|
+ case "苏通大桥":
|
|
|
+ st.add(deviceBo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ data.put("南京三桥", njsanq);
|
|
|
+ data.put("南京四桥", njsiq);
|
|
|
+ data.put("润扬大桥", ry);
|
|
|
+ data.put("泰州大桥", tz);
|
|
|
+ data.put("江阴大桥", jy);
|
|
|
+ data.put("苏通大桥", st);
|
|
|
+
|
|
|
+ return AjaxResult.success(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ public final static Map<String, String> orgMap = new HashMap<String, String>() {{
|
|
|
+ put("南京三桥", "南京海事局");
|
|
|
+ put("南京四桥", "南京海事局");
|
|
|
+ put("润扬大桥", "扬州海事局");
|
|
|
+ put("泰州大桥", "泰州海事局");
|
|
|
+ put("江阴大桥", "江阴海事局");
|
|
|
+ put("苏通大桥", "常熟海事局");
|
|
|
+ }};
|
|
|
+
|
|
|
}
|