编辑代码

import java.security.MessageDigest;
import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.time.format.DateTimeFormatter;
class Main {
	public static void main(String[] args) {
        //JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。
        String cphm="云A45432蓝";
        String cpys="white";
        String pkid = getNewWords(cphm+cpys);
		System.out.println("Hello world!   - java.jsrun.net "+pkid);
        LocalDateTime localDateTime = LocalDateTime.now();
        String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
        System.out.println("Hello world!   - java.jsrun.net "+localDateTime);

		System.out.println("Hello world!   - java.jsrun.net "+time);
        int a = 3500;
        Long b = new Long(a);

        System.out.println("Hello world!   - java.jsrun.net "+obdJudge("A",b,LocalDateTime.now()));

        

	}
//18ed5dfea2c260f37bf98aae8f745999

    
    public static String getNewWords(String words) {
        String retStr = "";
        try {
            // 创建MD5消息摘要对象
            MessageDigest md = MessageDigest.getInstance("MD5");
            // 计算消息的摘要
            byte[] digest = md.digest(words.getBytes());
            // 将摘要转换为十六进制字符串
            StringBuilder hexString = new StringBuilder();
            for (byte b : digest) {
                String hex = Integer.toHexString(0xff & b);
                if (hex.length() == 1) {
                    hexString.append('0');
                }
                hexString.append(hex);
            }
            retStr = hexString.toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return retStr;
    }

     private static boolean obdJudge(String fueltype, Long maxweight, LocalDateTime outfactorydate) {
        // 先定出来需要的那几个日期常量
        final String gasolineLessThen = "20110701";
        final String gasolineGreaterThen = "20130701";
        final String dieselOil = "20180101";
        
        double w = maxweight * 1.0 / 1000L;
             System.out.println("二万人哇42342 "+w);
              System.out.println("二万人哇42342 "+maxweight);
        String time =outfactorydate.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
            time ="20180101"
        if ("A".equals(fueltype)) {
            // 判断吨位
             w = maxweight * 1.0 / 1000L;
            if (w < 3.5) {
                // 判断出厂日期是否小于20110701
                return gasolineLessThen.compareTo(time) >= 0;
            }
            // 判断出厂日期是否小于20130701
            return gasolineGreaterThen.compareTo(time) >= 0;
        }
        // 直接比较出厂日期是否小于20180101
        return dieselOil.compareTo(time) >= 0;
    }
}