a
554325746@qq.com
2019-07-15 e6c8834e2aa2f3c1f46e588d94ae8ec6aa6c8dec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package com.basic.security.manager;
 
import com.basic.security.dao.SqliteManager;
 
import java.util.Date;
 
public class HomeManager extends SqliteManager {
 
    public static String getTodayEnters() {
        int TodayEnters = (RealTimeMetricsManager.getTotalEnters() - TodayBeginManager.getTotalEnters());
        TodayEnters = TodayEnters > 0 ? TodayEnters : 0;
        return TodayEnters+"";
    }
 
    public static String getTodayExits() {
        int TodayExits = (RealTimeMetricsManager.getTotalExits() - TodayBeginManager.getTotalExits());
        TodayExits = TodayExits > 0 ? TodayExits : 0;
        return TodayExits+"";
    }
 
    public static String getTodayRemaining() {
        int subtractResult = Integer.parseInt(getTodayEnters()) - Integer.parseInt(getTodayExits());
        if (subtractResult < 0) {
            subtractResult = 0;
        }
        int result = (
                subtractResult
                        +
                        SettingManager.getInitPerson()
                        +
                        SettingManager.getAdjustEnters()
        );
        if (result < 0) {
            result = 0;
        }
        return result+"";
    }
 
    public static String getTodayRemaining(Date date) {
        int subtractResult = (RealTimeMetricsManager.getTotalEnters(date) - TodayBeginManager.getTotalEnters(date))
                -
                (RealTimeMetricsManager.getTotalExits(date) - TodayBeginManager.getTotalExits(date));
        if (subtractResult < 0) {
            subtractResult = 0;
        }
        int result = (
                subtractResult
                        +
                        SettingManager.getInitPerson()
                        +
                        SettingManager.getAdjustEnters()
        );
        if (result < 0) {
            result = 0;
        }
        return result+"";
    }
 
    public static String getEntersSinceLastClear() {
        int result = (
                RealTimeMetricsManager.getTotalEnters()
                        -
                        ClearBeginManager.getTotalEnters()
        );
        if (result < 0) {
            ClearBeginManager.setTotalEnters(RealTimeMetricsManager.getTotalEnters());
            result = 0;
        }
        return result+"";
    }
 
    public static String getExitsSinceLastClear() {
        int result = (
                RealTimeMetricsManager.getTotalExits()
                        -
                        ClearBeginManager.getTotalExits()
        );
        if (result < 0) {
            ClearBeginManager.setTotalExits(RealTimeMetricsManager.getTotalExits());
            result = 0;
        }
        return result+"";
    }
 
}