Skip to content

Commit 9e4c2a3

Browse files
authored
Merge pull request #23 from bitkylin/developer
Developer 阶段更新为1.9.2版
2 parents 759bfd9 + 2647802 commit 9e4c2a3

File tree

47 files changed

+754
-283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+754
-283
lines changed

ClusterDevicePlatform-client/build.gradle

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
buildscript {
22
ext {
3-
springBootVersion = '2.0.0.RC2'
3+
springBootVersion = '2.0.0.RELEASE'
44
}
55
repositories {
66
mavenCentral()
7-
maven { url "https://repo.spring.io/snapshot" }
8-
maven { url "https://repo.spring.io/milestone" }
97
}
108
dependencies {
119
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
@@ -18,13 +16,11 @@ apply plugin: 'org.springframework.boot'
1816
apply plugin: 'io.spring.dependency-management'
1917

2018
group = 'cc.bitky.ClusterDevicePlatform'
21-
version = '1.8.9-release'
19+
version = '1.9.1-release'
2220
sourceCompatibility = 1.8
2321

2422
repositories {
2523
mavenCentral()
26-
maven { url "https://repo.spring.io/snapshot" }
27-
maven { url "https://repo.spring.io/milestone" }
2824
}
2925

3026
tasks.withType(JavaCompile) {
@@ -34,12 +30,12 @@ tasks.withType(JavaCompile) {
3430
dependencies {
3531
compile('org.springframework.boot:spring-boot-starter')
3632
compile('org.springframework.boot:spring-boot-starter-web')
37-
compile group: 'io.netty', name: 'netty-all', version: '4.1.19.Final'
38-
compile group: 'com.alibaba', name: 'fastjson', version: '1.2.44'
33+
compile group: 'io.netty', name: 'netty-all', version: '4.1.22.Final'
34+
compile group: 'com.alibaba', name: 'fastjson', version: '1.2.46'
3935
compile 'com.jfoenix:jfoenix:1.10.0'
4036
compile 'io.datafx:datafx:8.0.1'
4137
compile 'io.datafx:flow:8.0.1'
42-
compile files('../messageUtils/build/libs/messageUtils-1.8.jar')
38+
compile files('../messageUtils/build/libs/messageUtils-1.9.1.jar')
4339

4440
testCompile('org.springframework.boot:spring-boot-starter-test')
4541
}

ClusterDevicePlatform-client/src/main/java/cc/bitky/clusterdeviceplatform/client/config/CommSetting.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class CommSetting {
44
/**
55
* 待发送缓冲队列中,帧发送间隔「单位/ms」
66
*/
7-
public static int FRAME_SEND_INTERVAL = 50;
7+
public static int FRAME_SEND_INTERVAL = 10;
88
/**
99
* 服务器主机名
1010
*/

ClusterDevicePlatform-client/src/main/java/cc/bitky/clusterdeviceplatform/client/server/ServerWebHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ private void createNeedMsg(int probability, int errorProbability, int count) {
7373
}
7474

7575
public void runTest1() {
76-
createNeedMsg(1, 1, 1);
76+
createNeedMsg(1, 1, 100);
7777
}
7878
}

ClusterDevicePlatform-server/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
setting
22
src/test/java/
33
*.exe
4+
*.dll
45

56
/.gradle/
67
/build/
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
buildscript {
22
ext {
3-
springBootVersion = '2.0.0.RC2'
3+
springBootVersion = '2.0.0.RELEASE'
44
}
55
repositories {
66
mavenCentral()
7-
maven { url "https://repo.spring.io/snapshot" }
8-
maven { url "https://repo.spring.io/milestone" }
97
}
108
dependencies {
119
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
@@ -18,13 +16,11 @@ apply plugin: 'org.springframework.boot'
1816
apply plugin: 'io.spring.dependency-management'
1917

2018
group = 'cc.bitky.ClusterDevicePlatform'
21-
version = '1.8.9-release'
19+
version = '1.9.2-release'
2220
sourceCompatibility = 1.8
2321

2422
repositories {
2523
mavenCentral()
26-
maven { url "https://repo.spring.io/snapshot" }
27-
maven { url "https://repo.spring.io/milestone" }
2824
}
2925

3026
tasks.withType(JavaCompile) {
@@ -34,7 +30,8 @@ tasks.withType(JavaCompile) {
3430
dependencies {
3531
compile('org.springframework.boot:spring-boot-starter-data-mongodb-reactive')
3632
compile('org.springframework.boot:spring-boot-starter-web')
37-
compile 'io.netty:netty-all:4.1.19.Final'
38-
compile 'com.alibaba:fastjson:1.2.44'
39-
compile files('../messageUtils/build/libs/messageUtils-1.8.jar')
33+
compile 'io.netty:netty-all:4.1.22.Final'
34+
compile 'com.alibaba:fastjson:1.2.46'
35+
testCompile('org.springframework.boot:spring-boot-starter-test')
36+
compile files('../messageUtils/build/libs/messageUtils-1.9.1.jar')
4037
}

ClusterDevicePlatform-server/src/main/java/cc/bitky/clusterdeviceplatform/server/ServerApplication.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import cc.bitky.clusterdeviceplatform.server.config.DbSetting;
2121
import cc.bitky.clusterdeviceplatform.server.config.LocalProfile;
2222
import cc.bitky.clusterdeviceplatform.server.config.ServerSetting;
23+
import cc.bitky.clusterdeviceplatform.server.server.statistic.utils.IpUtil;
2324

2425
@SpringBootApplication
2526
public class ServerApplication {
@@ -99,6 +100,7 @@ private static boolean initSetting() {
99100
if (localProfile != null) {
100101
trimProfileProperty(localProfile);
101102
DbSetting.MONGODB_HOST = localProfile.数据库服务器的主机名或IP;
103+
DbSetting.MONGODB_IP = IpUtil.getIP(DbSetting.MONGODB_HOST)[0];
102104
CommSetting.FRAME_SEND_INTERVAL = localProfile.帧发送间隔;
103105
CommSetting.DEPLOY_REMAIN_CHARGE_TIMES = localProfile.部署剩余充电次数阈值 >= CommSetting.REMAIN_CHARGE_TIMES_CLEAR ? CommSetting.REMAIN_CHARGE_TIMES_CLEAR - 1 : localProfile.部署剩余充电次数阈值;
104106
DbSetting.DEFAULT_EMPLOYEE_CARD_NUMBER = localProfile.员工默认卡号;

ClusterDevicePlatform-server/src/main/java/cc/bitky/clusterdeviceplatform/server/config/DbSetting.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ public class DbSetting {
99
* MongoDB 的端口号
1010
*/
1111
public static int MONGODB_PORT = 27017;
12+
/**
13+
* MongoDB 的IP地址
14+
*/
15+
public static String MONGODB_IP = "未知";
1216
/**
1317
* 数据库
1418
*/

ClusterDevicePlatform-server/src/main/java/cc/bitky/clusterdeviceplatform/server/config/ServerSetting.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class ServerSetting {
1414
/**
1515
* 项目版本号
1616
*/
17-
public static final String VERSION = "1.8.9";
17+
public static final String VERSION = "1.9.1";
1818
/**
1919
* 本地配置文件名
2020
*/

ClusterDevicePlatform-server/src/main/java/cc/bitky/clusterdeviceplatform/server/db/DbPresenter.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import cc.bitky.clusterdeviceplatform.server.db.operate.DeviceOperate;
2323
import cc.bitky.clusterdeviceplatform.server.db.operate.EmployeeOperate;
2424
import cc.bitky.clusterdeviceplatform.server.db.statistic.repo.ProcessedMsgRepo;
25-
import cc.bitky.clusterdeviceplatform.server.db.work.bean.StatusItem;
25+
import cc.bitky.clusterdeviceplatform.server.server.repo.bean.StatusItem;
2626
import cc.bitky.clusterdeviceplatform.server.server.repo.DeviceStatusRepository;
2727
import cc.bitky.clusterdeviceplatform.server.server.repo.TcpFeedBackRepository;
2828
import cc.bitky.clusterdeviceplatform.server.tcp.statistic.except.TcpFeedbackItem;
@@ -108,17 +108,6 @@ public StatusItem obtainStatusByCache(int groupId, int deviceId, MsgReplyDeviceS
108108
return deviceStatusRepository.getStatus(groupId, deviceId, type);
109109
}
110110

111-
/**
112-
* 获取设备组最近通信时刻的时间戳
113-
*
114-
* @param groupId 设备组 ID
115-
* @return 特定的时间戳
116-
*/
117-
public long getDeviceGroupRecentCommTime(int groupId) {
118-
return deviceStatusRepository.getDeviceGroupRecentCommTime(groupId);
119-
}
120-
121-
122111
/**
123112
* 总帧数统计
124113
*

ClusterDevicePlatform-server/src/main/java/cc/bitky/clusterdeviceplatform/server/db/bean/Employee.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
import org.springframework.data.mongodb.core.mapping.Document;
55
import org.springframework.data.mongodb.core.mapping.Field;
66

7+
import java.util.Objects;
8+
79
@Document(collection = "Employee")
810
public class Employee {
911

1012
@Id
1113
private String id;
1214

13-
//个人信息
1415
@Field("Name")
1516
private String name;
1617

1718
@Field("Department")
1819
private String department;
1920

20-
//设备位置
2121
@Field("GroupId")
2222
private int groupId;
2323

@@ -79,4 +79,26 @@ public String toString() {
7979
", deviceId=" + deviceId +
8080
'}';
8181
}
82+
83+
@Override
84+
public boolean equals(Object o) {
85+
if (this == o) {
86+
return true;
87+
}
88+
if (o == null || getClass() != o.getClass()) {
89+
return false;
90+
}
91+
Employee employee = (Employee) o;
92+
return groupId == employee.groupId &&
93+
deviceId == employee.deviceId &&
94+
Objects.equals(id, employee.id) &&
95+
Objects.equals(name, employee.name) &&
96+
Objects.equals(department, employee.department);
97+
}
98+
99+
@Override
100+
public int hashCode() {
101+
102+
return Objects.hash(id, name, department, groupId, deviceId);
103+
}
82104
}

0 commit comments

Comments
 (0)