|
|
@ -4,10 +4,12 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
|
|
|
import com.glxp.udi.admin.common.enums.ResultEnum;
|
|
|
|
import com.glxp.udi.admin.common.res.BaseResponse;
|
|
|
|
import com.glxp.udi.admin.common.res.BaseResponse;
|
|
|
|
import com.glxp.udi.admin.dao.info.PlatformDao;
|
|
|
|
import com.glxp.udi.admin.dao.info.PlatformDao;
|
|
|
|
import com.glxp.udi.admin.dao.inout.UnitMaintainDao;
|
|
|
|
import com.glxp.udi.admin.dao.inout.UnitMaintainDao;
|
|
|
@ -182,4 +184,28 @@ public class PlatformService {
|
|
|
|
return ResultVOUtils.error(500, "获取自助平台接口异常");
|
|
|
|
return ResultVOUtils.error(500, "获取自助平台接口异常");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 测试自助平台连通性
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param host
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public BaseResponse testPlatformConnection(String host) {
|
|
|
|
|
|
|
|
String testUrl = host + "/udiwms/auth/device/connect";
|
|
|
|
|
|
|
|
String response = HttpUtil.get(testUrl);
|
|
|
|
|
|
|
|
if (StrUtil.isNotBlank(response)) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
BaseResponse result = JSONUtil.toBean(response, BaseResponse.class);
|
|
|
|
|
|
|
|
if (result.getCode() == 20000) {
|
|
|
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|