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
package com.dy.pipIrrMwTestRtu.tcpClient.upData;
 
import java.text.SimpleDateFormat;
import java.util.Locale;
 
/**
 * @Author: liurunyu
 * @Date: 2024/7/15 15:02
 * @Description
 */
public class UpConstant {
 
    private static String openValveDt ;
    private static String closeValveDt ;
 
    public static Integer instantAmount = 10123;//瞬时流量10.000
    public static Integer totalAmount = 1234567;//实为12345.67
    public static Integer remainMoney = 56789;//实为567.89
    public static Integer thisAmount = 0;//
    public static Integer thisMoney = 0;//
    public static Integer thisTime = 10;//实为10
    public static Integer thisPrice = 100;//实为1.00
 
    public static Integer perAmount = 10;
    public static Integer perMoney = 0;
 
 
    public static void clearOpenValveDt(){
        openValveDt = null ;
    }
 
    public static String openValveDt(){
        if(openValveDt == null){
            openValveDt = new SimpleDateFormat("yyMMddHHmmss", Locale.CHINA).format(System.currentTimeMillis());
        }
        return openValveDt ;
    }
 
    public static String closeValveDt(){
        closeValveDt = new SimpleDateFormat("yyMMddHHmmss", Locale.CHINA).format(System.currentTimeMillis());
        return closeValveDt ;
    }
 
    public static void addValve(){
        perMoney = perAmount / (thisPrice / 100) ;
        thisAmount += perAmount ;
        thisMoney += perMoney ;
 
        totalAmount = totalAmount + perAmount ;
        remainMoney = remainMoney - perMoney ;
    }
}