| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.common.core.domain.entity.SysConfig; |
| | | import com.ruoyi.health.client.EquipmentsHealthClient; |
| | | import com.ruoyi.health.param.GetEquipmentAlertInfoParam; |
| | | import com.ruoyi.health.param.GetFMTrendParam; |
| | | import com.ruoyi.health.param.GetTrendParam; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('sy:syCar:GetPartsAlertLeve')") |
| | | @ApiOperation("获取点") |
| | | @ApiOperation("获取ID获取点位") |
| | | @GetMapping("GetPartsAlertLevel") |
| | | public Results GetPartsAlertLevel(Integer id){ |
| | | List<SysConfig> sysConfigs = configService.getAccPwd(); |
| | |
| | | Map<String, Object> map = EquipmentsHealthClient.GetPartsAlertLeve(GetPartsAlertLeveUrl, token,id); |
| | | return Results.succeed(map); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('sy:syCar:GetEquipmentAlertInfo')") |
| | | @ApiOperation("根据ID获取详细说明") |
| | | @GetMapping("GetEquipmentAlertInfo") |
| | | public Results GetEquipmentAlertInfo(GetEquipmentAlertInfoParam param){ |
| | | Integer id = param.getId(); |
| | | String key = param.getPosition(); |
| | | List<SysConfig> sysConfigs = configService.getAccPwd(); |
| | | String account = null,password = null,url = null; |
| | | for (int i = 0; i < sysConfigs.size(); i++) { |
| | | SysConfig sysConfig = sysConfigs.get(i); |
| | | if("eqHealthUrl".equals(sysConfig.getConfigKey())){ |
| | | url = sysConfig.getConfigValue(); |
| | | } |
| | | if("eqHealthAccount".equals(sysConfig.getConfigKey())){ |
| | | account = sysConfig.getConfigValue(); |
| | | } |
| | | if("eqHealthPassword".equals(sysConfig.getConfigKey())){ |
| | | password = sysConfig.getConfigValue(); |
| | | } |
| | | } |
| | | String tokenUrl = url+"/RoadFlowApi/Home/ValidLogin"; |
| | | Map<String, Object> loginResult = EquipmentsHealthClient.getToken(tokenUrl, account, password); |
| | | String token = (String) ((Map<String, Object>) ((Map<String, Object>) loginResult.get("data")).get("data")).get("token"); |
| | | String GetEquipmentAlertInfoUrl = url + "/RoadFlowApi/ZX/MeasureData/GetEquipmentAlertInfo"; |
| | | Map<String, Object> map = EquipmentsHealthClient.GetEquipmentAlertInfo(GetEquipmentAlertInfoUrl, token,id); |
| | | List<Object> list = (List<Object>) ((Map<String, Object>) map.get("data")).get("rows"); |
| | | List<Map<String,Object>> rList = new ArrayList<>(); |
| | | if(list.size()>0){ |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Map<String,Object> listMap = (Map<String, Object>) list.get(i); |
| | | String position = (String) listMap.get("position"); |
| | | if(key.equals(position)){ |
| | | rList.add(listMap); |
| | | } |
| | | } |
| | | } |
| | | return Results.succeed(rList); |
| | | } |
| | | } |