| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.common.core.domain.entity.SysConfig; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.health.client.EquipmentsHealthClient; |
| | | import com.ruoyi.health.param.GetFMTrendParam; |
| | | import com.ruoyi.health.param.GetTrendParam; |
| | |
| | | @PreAuthorize("@ss.hasPermi('sy:syCar:GetPartsAlertLeve')") |
| | | @ApiOperation("获取点") |
| | | @GetMapping("GetPartsAlertLeve") |
| | | public Results GetPartsAlertLeve(){ |
| | | public Results GetPartsAlertLeve(Integer id){ |
| | | List<SysConfig> sysConfigs = configService.getAccPwd(); |
| | | String acc = null,pwd = null,hu = null; |
| | | 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())){ |
| | | hu = sysConfig.getConfigValue(); |
| | | url = sysConfig.getConfigValue(); |
| | | } |
| | | if("eqHealthAccount".equals(sysConfig.getConfigKey())){ |
| | | acc = sysConfig.getConfigValue(); |
| | | account = sysConfig.getConfigValue(); |
| | | } |
| | | if("eqHealthPassword".equals(sysConfig.getConfigKey())){ |
| | | pwd = sysConfig.getConfigValue(); |
| | | password = sysConfig.getConfigValue(); |
| | | } |
| | | } |
| | | Map<String, Object> loginResult = EquipmentsHealthClient.getToken(hu, acc, pwd); |
| | | 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 GetPartsAlertLeveUrl = hu + "/RoadFlowApi/ZX/MeasureData/GetPartsAlertLeve"; |
| | | Map<String, Object> map = EquipmentsHealthClient.GetPartsAlertLeve(GetPartsAlertLeveUrl, token); |
| | | String GetPartsAlertLeveUrl = url + "/RoadFlowApi/ZX/MeasureData/GetPartsAlertLevel"; |
| | | Map<String, Object> map = EquipmentsHealthClient.GetPartsAlertLeve(GetPartsAlertLeveUrl, token,id); |
| | | return Results.succeed(map); |
| | | } |
| | | } |