| New file | 
 |  |  | 
 |  |  | 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 ; | 
 |  |  |     } | 
 |  |  | } |