提交 1fcac0c0 authored 作者: wangqiang's avatar wangqiang

客户端更新

上级 f6dcd902
...@@ -64,6 +64,9 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall ...@@ -64,6 +64,9 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
@Value(value = "${apq.client.productId}") @Value(value = "${apq.client.productId}")
private Long productId; private Long productId;
@Value(value = "${apq.client.version}")
private String clientVersion;
@Value(value = "${apq.client.tenantId}") @Value(value = "${apq.client.tenantId}")
private Long tenantId; private Long tenantId;
...@@ -761,6 +764,7 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall ...@@ -761,6 +764,7 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
params.put("productId", productId); params.put("productId", productId);
params.put("tenantId", tenantId); params.put("tenantId", tenantId);
params.put("macAddress", mac); params.put("macAddress", mac);
params.put("clientVersion", clientVersion);
Map<String, String> map = System.getenv(); Map<String, String> map = System.getenv();
String computerName = map.get("COMPUTERNAME");// 获取计算机名 String computerName = map.get("COMPUTERNAME");// 获取计算机名
......
...@@ -4,8 +4,10 @@ import cn.hutool.core.collection.CollUtil; ...@@ -4,8 +4,10 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ConcurrentHashSet; import cn.hutool.core.collection.ConcurrentHashSet;
import cn.hutool.core.collection.ListUtil; import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.StreamProgress; import cn.hutool.core.io.StreamProgress;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
...@@ -129,6 +131,7 @@ public class ProgramController { ...@@ -129,6 +131,7 @@ public class ProgramController {
map.put("name", StrUtil.subBefore(o.getStr("fileName"), '.', true)); map.put("name", StrUtil.subBefore(o.getStr("fileName"), '.', true));
map.put("size", o.getStr("fileSize")); map.put("size", o.getStr("fileSize"));
map.put("version", o.getStr("version")); map.put("version", o.getStr("version"));
map.put("isUpgrade", o.getBool("isUpgrade", true).toString());
map.put("localVersion", null); map.put("localVersion", null);
map.put("url", o.getStr("url")); map.put("url", o.getStr("url"));
Long id = Convert.toLong(map.get("id")); Long id = Convert.toLong(map.get("id"));
...@@ -414,7 +417,8 @@ public class ProgramController { ...@@ -414,7 +417,8 @@ public class ProgramController {
log.info("执行自动安装文件 ==============2"); log.info("执行自动安装文件 ==============2");
list("upgrade", 1, 10000).getData().getRecords() list("upgrade", 1, 10000).getData().getRecords()
.parallelStream() .parallelStream()
.filter(m -> ObjectUtil.notEqual(m.get("version"), m.get("localVersion"))) // upgradeTime
.filter(m -> BooleanUtil.toBoolean(m.get("isUpgrade")) && ObjectUtil.notEqual(m.get("version"), m.get("localVersion")))
.forEach(m -> { .forEach(m -> {
log.info("执行自动安装文件 ==============3"); log.info("执行自动安装文件 ==============3");
String url = m.get("url"); String url = m.get("url");
......
...@@ -29,11 +29,10 @@ core: ...@@ -29,11 +29,10 @@ core:
maxInFlight: 1000 maxInFlight: 1000
security: security:
apiByMac: "${PC_API_BY_MAC:true}" apiByMac: "${PC_API_BY_MAC:true}"
# accessToken: "${PC_ACCESS_TOKEN:1hTbcWoaQvPzl2PpbkTG}" # accessToken: "${PC_ACCESS_TOKEN:1hTbcWoaQvPzl2PpbkTG}"
remoteConfiguration: false remoteConfiguration: false
extensions: extensions:
- - id: "http"
id: "http"
type: "HTTP" type: "HTTP"
extensionConfiguration: http-config.json extensionConfiguration: http-config.json
...@@ -46,6 +45,7 @@ apq: ...@@ -46,6 +45,7 @@ apq:
client: client:
productId: 210 productId: 210
tenantId: 156 tenantId: 156
version: V1.3.3
url: url:
device_info_g: /facility/facility/getByMacAddress?macAddress={} device_info_g: /facility/facility/getByMacAddress?macAddress={}
voiceCall: /facility/facility/voiceCall voiceCall: /facility/facility/voiceCall
......
...@@ -190,11 +190,10 @@ public class ApqInfoJob { ...@@ -190,11 +190,10 @@ public class ApqInfoJob {
cpuLoadV = Double.parseDouble(new DecimalFormat("#.00").format(sigar.getCpuPerc().getCombined() * 100)); cpuLoadV = Double.parseDouble(new DecimalFormat("#.00").format(sigar.getCpuPerc().getCombined() * 100));
double memFreeRate = Double.parseDouble(new DecimalFormat("#.00").format(mem.getFree() * 1.0 / mem.getTotal() * 100)); memoryOccupyRateV = Double.parseDouble(new DecimalFormat("#.00").format(mem.getUsed() * 1.0 / mem.getTotal() * 100));
memoryOccupyRateV = Double.parseDouble(new DecimalFormat("#.00").format(100 - memFreeRate));
memoryAvailableV = DataSizeUtil.format(mem.getFree()) + "/" + DataSizeUtil.format(mem.getTotal()) memoryAvailableV = DataSizeUtil.format(mem.getUsed()) + "/" + DataSizeUtil.format(mem.getTotal())
+ "(" + memFreeRate + "%)"; + "(" + memoryOccupyRateV + "%)";
// OperatingSystem OS = OperatingSystem.getInstance(); // OperatingSystem OS = OperatingSystem.getInstance();
......
...@@ -17,6 +17,7 @@ public class CoreTempUtil { ...@@ -17,6 +17,7 @@ public class CoreTempUtil {
static final String coreFromOs = "CoreTemp" + (OshiUtil.getOs().getBitness() == 64 ? "x64" : ""); static final String coreFromOs = "CoreTemp" + (OshiUtil.getOs().getBitness() == 64 ? "x64" : "");
static final String WR0_DLL_NAME = ParseUrlUtil.parseAbsolutePath("/core/" + coreFromOs + ".dll", System.getProperty("user.dir") + "/apq-pc-common"); static final String WR0_DLL_NAME = ParseUrlUtil.parseAbsolutePath("/core/" + coreFromOs + ".dll", System.getProperty("user.dir") + "/apq-pc-common");
// static final String WR0_DLL_NAME = ParseUrlUtil.parseAbsolutePath("/core/CoreTemp.dll", System.getProperty("user.dir") + "/apq-pc-common");
/** /**
* CPU温度 * CPU温度
......
...@@ -70,6 +70,7 @@ public interface IHwPortController extends Library { ...@@ -70,6 +70,7 @@ public interface IHwPortController extends Library {
//如果本地类库不是线程安全的,可用Native.synchronizedLibrary //如果本地类库不是线程安全的,可用Native.synchronizedLibrary
IHwPortController instanceDll = (IHwPortController) Native.loadLibrary(ParseUrlUtil.parseAbsolutePath("/dact/" + (OshiUtil.getOs().getBitness() == 64 ? "x64" : "x32") + "/HwPortController.dll", System.getProperty("user.dir") + "/apq-pc-common"), IHwPortController.class); IHwPortController instanceDll = (IHwPortController) Native.loadLibrary(ParseUrlUtil.parseAbsolutePath("/dact/" + (OshiUtil.getOs().getBitness() == 64 ? "x64" : "x32") + "/HwPortController.dll", System.getProperty("user.dir") + "/apq-pc-common"), IHwPortController.class);
// IHwPortController instanceDll = (IHwPortController) Native.loadLibrary(ParseUrlUtil.parseAbsolutePath("/dact/x32/HwPortController.dll", System.getProperty("user.dir") + "/apq-pc-common"), IHwPortController.class);
/** /**
* 初始化硬件接口管理模块 * 初始化硬件接口管理模块
......
package com.priusis.utils; package com.priusis.utils;
import cn.hutool.system.oshi.OshiUtil;
import com.sun.jna.Library; import com.sun.jna.Library;
import com.sun.jna.Memory; import com.sun.jna.Memory;
import com.sun.jna.Native; import com.sun.jna.Native;
...@@ -12,7 +13,8 @@ import lombok.extern.slf4j.Slf4j; ...@@ -12,7 +13,8 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j
public class ProcessExtensionsApqUtil { public class ProcessExtensionsApqUtil {
static final String CP_DLL_NAME = ParseUrlUtil.parseAbsolutePath("/core/apq_CreatProcess.dll", System.getProperty("user.dir") + "/apq-pc-common"); static final String CP_DLL_NAME = ParseUrlUtil.parseAbsolutePath("/core/apq_CreatProcess" + (OshiUtil.getOs().getBitness() == 64 ? "x64" : "") + ".dll", System.getProperty("user.dir") + "/apq-pc-common");
// static final String CP_DLL_NAME = ParseUrlUtil.parseAbsolutePath("/core/apq_CreatProcess.dll", System.getProperty("user.dir") + "/apq-pc-common");
static ProcessExtensionsApq CP_API_INSTANCE = Native.loadLibrary(CP_DLL_NAME, ProcessExtensionsApq.class); static ProcessExtensionsApq CP_API_INSTANCE = Native.loadLibrary(CP_DLL_NAME, ProcessExtensionsApq.class);
/** /**
......
...@@ -17,6 +17,8 @@ import java.util.Map; ...@@ -17,6 +17,8 @@ import java.util.Map;
public class WinRing0Util { public class WinRing0Util {
static final String WR0_DLL_NAME = ParseUrlUtil.parseAbsolutePath("/core/WinRing0" + (OshiUtil.getOs().getBitness() == 64 ? "x64" : "") + ".dll", static final String WR0_DLL_NAME = ParseUrlUtil.parseAbsolutePath("/core/WinRing0" + (OshiUtil.getOs().getBitness() == 64 ? "x64" : "") + ".dll",
System.getProperty("user.dir") + "/apq-pc-common"); System.getProperty("user.dir") + "/apq-pc-common");
// static final String WR0_DLL_NAME = ParseUrlUtil.parseAbsolutePath("/core/WinRing0.dll",
// System.getProperty("user.dir") + "/apq-pc-common");
static WR0 WR0_INSTANCE = Native.loadLibrary(WR0_DLL_NAME, WR0.class); static WR0 WR0_INSTANCE = Native.loadLibrary(WR0_DLL_NAME, WR0.class);
......
...@@ -348,7 +348,7 @@ public class SigarUtil { ...@@ -348,7 +348,7 @@ public class SigarUtil {
String writess = String.format("%.1f", writes) + " KB/s"; String writess = String.format("%.1f", writes) + " KB/s";
sb.append("\"readss\":\"").append(readss).append("\","); sb.append("\"readss\":\"").append(readss).append("\",");
sb.append("\"writess\":\"").append(writess); sb.append("\"writess\":\"").append(writess).append("\"");
} catch (Exception e) { } catch (Exception e) {
log.error("获取硬盘传输速度异常", e); log.error("获取硬盘传输速度异常", e);
} }
......
; Script generated by the Inno Setup Script Wizard. ; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "阿普奇检测客户端_x32" #define MyAppName "阿普奇检测客户端"
#define MyAppVersion "V1.3" #define MyAppVersion "V1.3.2"
#define MyAppPublisher "阿普奇" #define MyAppPublisher "阿普奇"
#define MyAppURL "https://www.apq.com/" #define MyAppURL "https://www.apq.com/"
#define MyAppDirName "apq-client" #define MyAppDirName "apq-client"
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "阿普奇检测客户端" #define MyAppName "阿普奇检测客户端"
#define MyAppVersion "V1.3" #define MyAppVersion "V1.3.1"
#define MyAppPublisher "阿普奇" #define MyAppPublisher "阿普奇"
#define MyAppURL "https://www.apq.com/" #define MyAppURL "https://www.apq.com/"
#define MyAppDirName "apq-client" #define MyAppDirName "apq-client"
#define MyAppEnName "apq-client" #define MyAppEnName "apq-client"
#define MyAppExeName "apq-client.exe" #define MyAppExeName "apq-client.exe"
; apq-iot-client ; apq-iot-client
#define MyAppInstallPwd "2a96d11973c7caa1a72eb816d7db6d17" #define MyAppInstallPwd "2a96d11973c7caa1a72eb816d7db6d17"
; hk-remove2022 ; hk-remove2022
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论