package com.muyu.controller;

import com.alibaba.fastjson.JSONObject;

/**
 * @Author：liuxinyue
 * @Package：com.muyu.controller
 * @Project：cloud-server
 * @name：TemplateService
 * @Date：2024/9/22 22:02
 */
public class TemplateService {

    public void messageParsing(String templateMessage){

        //创建一个JSON对象
        JSONObject jsonObject = new JSONObject();
        if(templateMessage.length()<18){
            throw new RuntimeException("错误VIN码,不存在此车");
        }

        //将报文进行切割
        String[] split = templateMessage.split(" ");
        StringBuilder stringBuilder = new StringBuilder();
        for (String s : split) {

            int i = Integer.parseInt(s, 16);
            stringBuilder.append((char)i);

        }
        //取出车辆的VIN码值


    }

    public static void main(String[] args) {

    }


}
