|  |  | 
 |  |  | package com.doumee.core.utils; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | import com.alibaba.fastjson.JSONObject; | 
 |  |  | import com.fasterxml.jackson.annotation.JsonInclude; | 
 |  |  | import com.fasterxml.jackson.core.JsonProcessingException; | 
 |  |  | import com.fasterxml.jackson.databind.ObjectMapper; | 
 |  |  | 
 |  |  |  | 
 |  |  | import java.io.IOException; | 
 |  |  | import java.math.BigDecimal; | 
 |  |  | import java.math.BigInteger; | 
 |  |  | import java.text.Collator; | 
 |  |  | import java.text.SimpleDateFormat; | 
 |  |  | import java.util.*; | 
 |  |  | 
 |  |  |  | 
 |  |  | public class Constants { | 
 |  |  |     public static final String HEADER_USER_TOKEN = "dm_user_token"; | 
 |  |  |     public static final String REDIS_USER_KEY = "user_token_list_"; | 
 |  |  |     public static final String REDIS_TOKEN_KEY = "token_"; | 
 |  |  |     public static final String REDIS_HK_TOKEN_KEY = "hk_token_"; | 
 |  |  |     public static final String HK_TOKEN_VALIDITY = "HK_TOKEN_VALIDITY"; | 
 |  |  | 
 |  |  |     public static final String HK_HTTPS ="HK_HTTPS" ; | 
 |  |  |     public static final String HK_PUSH_URL = "HK_PUSH_URL"; | 
 |  |  |     public static final String HK_CARS_OPENAPI_ACCESS_KEY = "HK_CARS_OPENAPI_ACCESS_KEY"; | 
 |  |  |     public static final String GAODE_DISTANCE_GEOAPI_URL = "GAODE_DISTANCE_GEOAPI_URL"; | 
 |  |  |     public static final String HK_CARS_OPENAPI_ACCESS_SECRET = "HK_CARS_OPENAPI_ACCESS_SECRET"; | 
 |  |  |     public static final String HK_CARS_OPENAPI_URL = "HK_CARS_OPENAPI_URL"; | 
 |  |  |     public static final String HK_ROOTORG_CODE ="HK_ROOTORG_CODE" ; | 
 |  |  | 
 |  |  |     public static final String SIGN_IN_ATTENTION ="SIGN_IN_ATTENTION" ; | 
 |  |  |     public static final String SIGN_IN_QRCODE_PREFIX ="SIGN_IN_QRCODE_PREFIX" ; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 操作类型,用于做接口验证分组 | 
 |  |  |      */ | 
 |  |  |     public interface OperaType { | 
 |  |  |  | 
 |  |  |         /** | 
 |  |  |          * 创建 | 
 |  |  |          */ | 
 |  |  |         interface Create {} | 
 |  |  |  | 
 |  |  |         /** | 
 |  |  |          * 修改 | 
 |  |  |          */ | 
 |  |  |         interface Update {} | 
 |  |  |  | 
 |  |  |         /** | 
 |  |  |          * 修改状态 | 
 |  |  |          */ | 
 |  |  |         interface UpdateStatus {} | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static final String WEATHER_CONFIG ="WEATHER_CONFIG" ; | 
 |  |  |     public static final String REQUEST_URL ="REQUEST_URL" ; | 
 |  |  |     public static final String LOCATION ="LOCATION" ; | 
 |  |  |     public static final String API_KEY ="API_KEY" ; | 
 |  |  |     public static final String CABINET_CONFIG ="CABINET_CONFIG" ; | 
 |  |  |     public static final String BLOW_TIME ="BLOW_TIME" ; | 
 |  |  |     public static final String PRESSURE ="PRESSURE" ; | 
 |  |  |     public static final String CONCENTRATION ="CONCENTRATION" ; | 
 |  |  |     public static final String THRESHOLD ="THRESHOLD" ; | 
 |  |  |     public static final String LINK_PHONE ="LINK_PHONE" ; | 
 |  |  |     //被拜访人信息校验方式(0手机号单独校验 1手机号和姓名组合校验) | 
 |  |  |     public static final String BEVISITED_USER_VALID = "BEVISITED_USER_VALID"; | 
 |  |  |     public static final String LW_BEVISITED_USER_VALID = "LW_BEVISITED_USER_VALID"; | 
 |  |  | 
 |  |  |     public static final String FTP_USERNAME ="FTP_USERNAME" ; | 
 |  |  |     public static final String FTP_PWD ="FTP_PWD" ; | 
 |  |  |     public static final String COMPANY_DOCUMENTS ="COMPANY_DOCUMENTS" ; | 
 |  |  |     public static final String APP_FILE ="APP_FILE" ; | 
 |  |  |  | 
 |  |  |     public static final String FTP_RESOURCE_PATH ="FTP_RESOURCE_PATH" ; | 
 |  |  |     public static final String FTP_LOCAL_RESOURCE_PATH ="FTP_LOCAL_RESOURCE_PATH" ; | 
 |  |  | 
 |  |  |     public static final String LIQUID_LEVEL_UNIT ="LIQUID_LEVEL_UNIT" ; | 
 |  |  |     public static final String OUT_HY_LOT_TOTAL ="OUT_HY_LOT_TOTAL" ; | 
 |  |  |     public static final String BANNER_IMG ="BANNER_IMG" ; | 
 |  |  |     public static final String COMPANY_LOCATION = "COMPANY_LOCATION"; | 
 |  |  |     public static final String GAODE_LOCATION_GEOAPI_URL = "GAODE_LOCATION_GEOAPI_URL"; | 
 |  |  |  | 
 |  |  |     public static  boolean DEALING_HK_SYNCPRIVILEGE= false; | 
 |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public static final String PROHIBIT_TIME = "PROHIBIT_TIME"; | 
 |  |  |     public static final String ERR_TIMES = "ERR_TIMES"; | 
 |  |  |     public static final String PROHIBIT_LOGIN_OPEN = "PROHIBIT_LOGIN_OPEN"; | 
 |  |  |     public static final String OPEN_JOINT_ACCOUNT = "OPEN_JOINT_ACCOUNT"; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public interface RedisKeys { | 
 |  |  |         public static final String IMPORTING_CARS ="IMPORTING_CARS"; | 
 |  |  |         public static final String CHECKING_JKCUSTOMER_LOCATION ="CHECKING_JKCUSTOMER_LOCATION"; | 
 |  |  |         public static final String JKLINE_JOB ="JKLINE_JOB_"; | 
 |  |  |         public static final String IMPORTING_JKCUSTOMER ="IMPORTING_JKCUSTOMER"; | 
 |  |  |         public static final String IMPORTING_JKORDERS ="IMPORTING_JKORDERS"; | 
 |  |  |         public static final String IMPORTING_JKLINE ="IMPORTING_JKLINE"; | 
 |  |  | 
 |  |  |         return  d; | 
 |  |  |     } | 
 |  |  |     public static BigDecimal formatBigdecimal4Float(BigDecimal d) { | 
 |  |  |         return  formatBigdecimalScale(d,4); | 
 |  |  |     } | 
 |  |  |     public static BigDecimal formatBigdecimalScale(BigDecimal d,int scale) { | 
 |  |  |         if (d == null) { | 
 |  |  |             d = new BigDecimal(0.0); | 
 |  |  |         } | 
 |  |  |         //保留两位小数且四舍五入 | 
 |  |  |         d = d.setScale(4, BigDecimal.ROUND_HALF_UP); | 
 |  |  |         d = d.setScale(scale, BigDecimal.ROUND_HALF_UP); | 
 |  |  |         return  d; | 
 |  |  |     } | 
 |  |  |     public static BigDecimal formatBigdecimal0Float(BigDecimal d) { | 
 |  |  |         if (d == null) { | 
 |  |  |             d = new BigDecimal(0.0); | 
 |  |  |         } | 
 |  |  |         //保留两位小数且四舍五入 | 
 |  |  |         d = d.setScale(0, BigDecimal.ROUND_HALF_UP); | 
 |  |  |         return  d; | 
 |  |  |         return  formatBigdecimalScale(d,0); | 
 |  |  |     } | 
 |  |  |     public static BigDecimal formatBigdecimal2Float(BigDecimal d) { | 
 |  |  |         if (d == null) { | 
 |  |  |             d = new BigDecimal(0.0); | 
 |  |  |         } | 
 |  |  |         //保留两位小数且四舍五入 | 
 |  |  |         d = d.setScale(2, BigDecimal.ROUND_HALF_UP); | 
 |  |  |         return  d; | 
 |  |  |         return  formatBigdecimalScale(d,2); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  | //        System.out.println(Constants.getVehiclePlateNo("湘B140D17").getDescription()); | 
 |  |  | //        System.out.println(Constants.getVehiclePlateNo("宿AP0637").getDescription()); | 
 |  |  |  | 
 |  |  |         System.out.println( "{\"data\":{\"paramValues\":{\"accessType\":\"2\",\"certTypes\":\"111\",\"certificateNos\":\"340122199904297373\",\"defineEventType\":\"771760131\",\"eventId\":\"6eb4a18bf3744c4385adb37eecdc9d37_634acece3fcf0_3d87\",\"eventType\":\"541200060\",\"eventTypeName\":\"\",\"extEventCardNo\":\"\",\"extEventPictureURL\":\"/pic?9d9c568c1a2do-4el*71-871o9=1524*7l9=0507*3607416=7147*=t212**ps5=2*8b9=559838d9837371-b162of-5pi2dc3=88=20c\",\"extEventReaderID\":\"\",\"extEventReaderKind\":\"\",\"gateIndex\":\"fc92c663ffb9420994f2574469f35e2d\",\"gateName\":\"安泰西门\",\"happenTime\":\"2025-05-09T13:06:13.000+08:00\",\"inOrOut\":\"0\",\"invoicesIds\":\"9857A54DAD5947EDB032575ECDD9EA4Bf4ebb8b61e344cd09118bfbdb5ff285c\",\"parkIndex\":\"1c4cdb8b66ed4c23bacb385c3fb6c46b\",\"parkName\":\"停车场\",\"phones\":\"19956520776\",\"plateNos\":\"皖AAA1652\",\"srcIndex\":\"6eb4a18bf3744c4385adb37eecdc9d37\",\"srcName\":\"\",\"srcParentIndex\":\"\",\"srcType\":\"roadway\",\"svrIndexCode\":\"eae18a71-1ffd-4e72-bcf6-998c5977630d\",\"userType\":\"\",\"visitorNames\":\"俞扬\"},\"targetPerson\":{\"certType\":\"111\",\"createTime\":\"2024-08-19T17:43:09.966+08:00\",\"jobNo\":\"18055162696\",\"mobile\":\"18055162696\",\"name\":\"朱之萌\",\"orgId\":\"d815b989-877a-40e7-8f34-a5388295a3d2\",\"orgPathName\":\"安泰物流园区/安泰物流/综合管理科\",\"personId\":\"1d8d42233bce4722a741917de4195084\",\"personNumber\":\"18055162696\",\"pinyin\":\"zhuzhimeng\",\"sex\":\"1\",\"updateTime\":\"2025-05-09T11:20:42.000+08:00\",\"userName\":\"18055162696\"},\"visitorInformationList\":[{\"appointmentCode\":\"947384\",\"cardNo\":\"6206767065588\",\"certNo\":\"340122199904297373\",\"certType\":111,\"companionPerson\":\"0\",\"createTime\":\"2025-05-09T13:04:26.740+08:00\",\"faceUrl\":\"2ffa5b542ec2448f9033e6901b326f44\",\"phone\":\"19956520776\",\"plateNo\":\"皖AAA1652\",\"sex\":1,\"unit\":\"安徽东百保安服务有限公司\",\"updateTime\":\"2025-05-09T13:05:36.472+08:00\",\"visitNum\":\"0\",\"visitorId\":\"6424f11498de48228fb2a418d3fc3bb1\",\"visitorName\":\"俞扬\"}],\"visitorInvoices\":{\"appointmentType\":\"3\",\"authIssueStatus\":\"1\",\"beginTime\":\"2025-05-09T13:01:00.000+08:00\",\"campusId\":\"root000000\",\"campusName\":\"默认园区\",\"createTime\":\"2025-05-09T13:04:26.693+08:00\",\"extendJson\":\"\",\"finishTime\":\"2025-05-09T14:01:00.000+08:00\",\"ifInfoAbnormal\":\"0\",\"invoicesId\":\"9857A54DAD5947EDB032575ECDD9EA4Bf4ebb8b61e344cd09118bfbdb5ff285c\",\"invoicesNo\":\"FK20250509130002\",\"invoicesStatus\":\"1\",\"isRepast\":\"0\",\"type\":\"0\",\"updateTime\":\"2025-05-09T13:05:30.372+08:00\",\"visitReason\":\"-1\",\"visitReasonName\":\"其他\",\"visitTargetId\":\"1d8d42233bce4722a741917de4195084\",\"workflowInitiatorId\":\"6424f11498de48228fb2a418d3fc3bb1\",\"workflowInitiatorType\":\"0\",\"workflowInstanceId\":\"7010a8521de54f088331e7176b82fd10\"}},\"eventId\":\"b5024c7b6c8b4b5587baf42dc5bce025\",\"eventType\":541200060,\"happenTime\":\"2025-05-09T13:06:14+08:00\",\"srcIndex\":\"9857A54DAD5947EDB032575ECDD9EA4Bf4ebb8b61e344cd09118bfbdb5ff285c\",\"srcType\":\"9857A54DAD5947EDB032575ECDD9EA4Bf4ebb8b61e344cd09118bfbdb5ff285c\",\"status\":0,\"timeout\":0}"); | 
 |  |  |         System.out.println("{\"data\":{\"paramValues\":{\"accessType\":\"2\",\"certTypes\":\"111\",\"certificateNos\":\"340122199904297373\",\"defineEventType\":\"771760134\",\"eventId\":\"6cf8a9b5cb614bddb74f338701975ade_634ad693b6b33_3db4\",\"eventType\":\"541200060\",\"eventTypeName\":\"\",\"extEventCardNo\":\"\",\"extEventPictureURL\":\"/pic?9d9c568c1a2do-4el*81-891*9o3=5563*4l0=0206706794t6=318**ps==515b*=5698*8d9835393-b9667f-1pi1dco=852c2=083\",\"extEventReaderID\":\"\",\"extEventReaderKind\":\"\",\"gateIndex\":\"fc92c663ffb9420994f2574469f35e2d\",\"gateName\":\"安泰西门\",\"happenTime\":\"2025-05-09T13:40:59.000+08:00\",\"inOrOut\":\"1\",\"invoicesIds\":\"9857A54DAD5947EDB032575ECDD9EA4Bf4ebb8b61e344cd09118bfbdb5ff285c\",\"parkIndex\":\"1c4cdb8b66ed4c23bacb385c3fb6c46b\",\"parkName\":\"停车场\",\"phones\":\"19956520776\",\"plateNos\":\"皖AAA1652\",\"srcIndex\":\"6cf8a9b5cb614bddb74f338701975ade\",\"srcName\":\"\",\"srcParentIndex\":\"\",\"srcType\":\"roadway\",\"svrIndexCode\":\"eae18a71-1ffd-4e72-bcf6-998c5977630d\",\"userType\":\"\",\"visitorNames\":\"俞扬\"},\"targetPerson\":{\"certType\":\"111\",\"createTime\":\"2024-08-19T17:43:09.966+08:00\",\"jobNo\":\"18055162696\",\"mobile\":\"18055162696\",\"name\":\"朱之萌\",\"orgId\":\"d815b989-877a-40e7-8f34-a5388295a3d2\",\"orgPathName\":\"安泰物流园区/安泰物流/综合管理科\",\"personId\":\"1d8d42233bce4722a741917de4195084\",\"personNumber\":\"18055162696\",\"pinyin\":\"zhuzhimeng\",\"sex\":\"1\",\"updateTime\":\"2025-05-09T11:20:42.000+08:00\",\"userName\":\"18055162696\"},\"visitorInformationList\":[{\"appointmentCode\":\"947384\",\"cardNo\":\"6206767065588\",\"certNo\":\"340122199904297373\",\"certType\":111,\"companionPerson\":\"0\",\"createTime\":\"2025-05-09T13:04:26.740+08:00\",\"faceUrl\":\"2ffa5b542ec2448f9033e6901b326f44\",\"phone\":\"19956520776\",\"plateNo\":\"皖AAA1652\",\"sex\":1,\"unit\":\"安徽东百保安服务有限公司\",\"updateTime\":\"2025-05-09T13:05:36.472+08:00\",\"visitNum\":\"0\",\"visitorId\":\"6424f11498de48228fb2a418d3fc3bb1\",\"visitorName\":\"俞扬\"}],\"visitorInvoices\":{\"appointmentType\":\"3\",\"authIssueStatus\":\"1\",\"beginTime\":\"2025-05-09T13:01:00.000+08:00\",\"campusId\":\"root000000\",\"campusName\":\"默认园区\",\"createTime\":\"2025-05-09T13:04:26.693+08:00\",\"extendJson\":\"\",\"finishTime\":\"2025-05-09T14:01:00.000+08:00\",\"ifInfoAbnormal\":\"0\",\"invoicesId\":\"9857A54DAD5947EDB032575ECDD9EA4Bf4ebb8b61e344cd09118bfbdb5ff285c\",\"invoicesNo\":\"FK20250509130002\",\"invoicesStatus\":\"5\",\"isRepast\":\"0\",\"type\":\"0\",\"updateTime\":\"2025-05-09T13:41:00.369+08:00\",\"visitReason\":\"-1\",\"visitReasonName\":\"其他\",\"visitTargetId\":\"1d8d42233bce4722a741917de4195084\",\"workflowInitiatorId\":\"6424f11498de48228fb2a418d3fc3bb1\",\"workflowInitiatorType\":\"0\",\"workflowInstanceId\":\"7010a8521de54f088331e7176b82fd10\"}},\"eventId\":\"2bb6700a9e4f48849227100243f470b2\",\"eventType\":541200060,\"happenTime\":\"2025-05-09T13:41:00+08:00\",\"srcIndex\":\"9857A54DAD5947EDB032575ECDD9EA4Bf4ebb8b61e344cd09118bfbdb5ff285c\",\"srcType\":\"9857A54DAD5947EDB032575ECDD9EA4Bf4ebb8b61e344cd09118bfbdb5ff285c\",\"status\":0,\"timeout\":0}"); | 
 |  |  | //        0789150665 C97B092F 0789150561 | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         System.out.println(getRFIDNumber("0789150745")); // 输出反转后的十六进制数 | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public static String getRFIDNumber(String no) { | 
 |  |  |         try { | 
 |  |  |             int number = Integer.parseInt(no); | 
 |  |  |             String hexString = Integer.toHexString(number); | 
 |  |  |             BigInteger bigInteger = new BigInteger(hexString, 16); // 示例十六进制数 | 
 |  |  |             String reversedHex = new StringBuilder(bigInteger.toString(16)).reverse().toString(); | 
 |  |  |             String result = ""; | 
 |  |  |             for (int i =0;i< 4;i++){ | 
 |  |  |                 String t = reversedHex.substring(i*2,i*2+2); | 
 |  |  |                 result += new StringBuilder(t).reverse().toString(); | 
 |  |  |             } | 
 |  |  |             return result; | 
 |  |  |         }catch (Exception e){ | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |         return  null; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 数据状态枚举 | 
 |  |  | 
 |  |  |         public String getNoteinfo() { | 
 |  |  |             return noteinfo; | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public static String strToJson(String key,String val){ | 
 |  |  |         Map<String,Object> map = new HashMap<>(); | 
 |  |  |         map.put(key,val); | 
 |  |  |         return JSONObject.toJSONString(map); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     public  enum WarningConfig { | 
 |  |  |         ALARM_TEST(10002, "酒精测试"), | 
 |  |  |         GRID_TIME_OUT_INFO(10003, "开门超时未关闭"), | 
 |  |  |         KEY_TIME_OUT_BACK(10004, "钥匙超时未归还"), | 
 |  |  |         ; | 
 |  |  |         // 成员变量 | 
 |  |  |         private int key; | 
 |  |  |         private String info; | 
 |  |  |  | 
 |  |  |         // 构造方法 | 
 |  |  |         WarningConfig(int key,String info) { | 
 |  |  |             this.key = key; | 
 |  |  |             this.info = info; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         public int getKey() { | 
 |  |  |             return key; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         public void setKey(int key) { | 
 |  |  |             this.key = key; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         public String getInfo() { | 
 |  |  |             return info; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         public void setInfo(String info) { | 
 |  |  |             this.info = info; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } |