|  |  |  | 
|---|
|  |  |  | package com.doumee.core.utils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
|---|
|  |  |  | import com.doumee.core.model.LoginUserInfo; | 
|---|
|  |  |  | import com.fasterxml.jackson.annotation.JsonInclude; | 
|---|
|  |  |  | import com.fasterxml.jackson.core.JsonProcessingException; | 
|---|
|  |  |  | import com.fasterxml.jackson.databind.ObjectMapper; | 
|---|
|  |  |  | import com.fasterxml.jackson.databind.PropertyNamingStrategy; | 
|---|
|  |  |  | import io.swagger.models.auth.In; | 
|---|
|  |  |  | import org.apache.batik.util.Platform; | 
|---|
|  |  |  | import net.sourceforge.pinyin4j.PinyinHelper; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.springframework.util.CollectionUtils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.io.IOException; | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.net.URLDecoder; | 
|---|
|  |  |  | import java.net.URLEncoder; | 
|---|
|  |  |  | import java.text.Collator; | 
|---|
|  |  |  | import java.text.SimpleDateFormat; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.Arrays; | 
|---|
|  |  |  | import  java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Random; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.regex.Matcher; | 
|---|
|  |  |  | 
|---|
|  |  |  | public static final Integer THREE =3 ; | 
|---|
|  |  |  | public static final Integer FOUR =4 ; | 
|---|
|  |  |  | public static final Integer FIVE =5 ; | 
|---|
|  |  |  | public static final Integer SIX =6 ; | 
|---|
|  |  |  | public static final String ORG_USER_ORIGIN = "ORG_USER_ORIGIN"; | 
|---|
|  |  |  | public static final String VIRTUAL_CARD_INDEX = "02098469790"; | 
|---|
|  |  |  | public static final String RETRY_CONNECT_NUM ="RETRY_CONNECT_NUM" ; | 
|---|
|  |  |  | 
|---|
|  |  |  | public static final String HK_WXTOKEN_CONFIGID ="HK_WXTOKEN_CONFIGID" ; | 
|---|
|  |  |  | public static final String HK_WXTOKEN_TAGID ="HK_WXTOKEN_TAGID" ; | 
|---|
|  |  |  | public static final String WMS_TOTAL_STOCK_NUM ="WMS_TOTAL_STOCK_NUM" ; | 
|---|
|  |  |  | public static final String WMS_LIQUID_LEVEL ="WMS_LIQUID_LEVEL" ; | 
|---|
|  |  |  | public static final String WMS_PRESSURE_LEVEL ="WMS_PRESSURE_LEVEL" ; | 
|---|
|  |  |  | public static final String WX_REDIRECT_URL = "WX_REDIRECT_URL"; | 
|---|
|  |  |  | public static final String HK_CHANGNEI_SCREEN_INDEXCODES = "HK_CHANGNEI_SCREEN_INDEXCODES"; | 
|---|
|  |  |  | public static final String CITY_XH_REASON_ID ="CITY_XH_REASON_ID" ; | 
|---|
|  |  |  | public static final String ATWL_XH_PLATFORM_ID ="ATWL_XH_PLATFORM_ID" ; | 
|---|
|  |  |  | public static final String SCREEN_SEVENT_ARRIVAL_STARTDATE = "SCREEN_SEVENT_ARRIVAL_STARTDATE"; | 
|---|
|  |  |  | public static final String EARLY_START_WX_NOTICE = "EARLY_START_WX_NOTICE"; | 
|---|
|  |  |  | public static final String OVER_NOTICE_WX = "OVER_NOTICE_WX"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static  boolean DEALING_HK_SYNCPRIVILEGE= false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_SYNCDEVICE = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_SYNCPLATFORM = false; | 
|---|
|  |  |  | 
|---|
|  |  |  | return ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int l = s.length(); | 
|---|
|  |  |  | if(Constants.equalsInteger(l,7)){ | 
|---|
|  |  |  | return s.substring(0,3)+"**"+s.substring(l-2,l); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(l <= 8){ | 
|---|
|  |  |  | return s.substring(0,3)+"***"+s.substring(l-2,l); | 
|---|
|  |  |  | if(l >= 7){ | 
|---|
|  |  |  | String tt = ""; | 
|---|
|  |  |  | for (int i = 0; i < l-6; i++) { | 
|---|
|  |  |  | tt = tt+"*"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return s.substring(0,2)+tt+s.substring(l-4,l); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return s; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | int selfTruck = 3; | 
|---|
|  |  |  | int outTruck = 4; | 
|---|
|  |  |  | int cityComTruck = 5; | 
|---|
|  |  |  | int unknown = 6; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 运单了单位类型 0万支 1箱 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static final  int UNIT_TYPE =1; | 
|---|
|  |  |  | public interface  memberType{ | 
|---|
|  |  |  | int driver = 0;//司机人员 | 
|---|
|  |  |  | int visitor = 1;//普通访客 | 
|---|
|  |  |  | int internal = 2;//内部人员 | 
|---|
|  |  |  | int gkuser = 3;//管控人员(运单查询) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | int reason = 6;//入园原因 | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public interface  noticesObjectType{ | 
|---|
|  |  |  | int visit = 0;//访客申请 | 
|---|
|  |  |  | int visitReporting = 1;//访客报备 | 
|---|
|  |  |  | int useCar = 2;//用车申请 | 
|---|
|  |  |  | int dangerDeal = 3;//隐患处理 | 
|---|
|  |  |  | int logisticsCarUse = 4;//物流车审批 | 
|---|
|  |  |  | int system = 5;//系统消息 | 
|---|
|  |  |  | int reason = 6;//入园原因 | 
|---|
|  |  |  | int hknotice = 7;//海康考勤代办 | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static Integer  approveTypeToNoticeType(Integer approveType){ | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public interface  noticesObjectType{ | 
|---|
|  |  |  | int visit = 0;//访客申请 | 
|---|
|  |  |  | int visitReporting = 1;//访客报备 | 
|---|
|  |  |  | int useCar = 2;//用车申请 | 
|---|
|  |  |  | int dangerDeal = 3;//隐患处理 | 
|---|
|  |  |  | int logisticsCarUse = 4;//物流车审批 | 
|---|
|  |  |  | int system = 5;//系统消息 | 
|---|
|  |  |  | int reason = 6;//入园原因 | 
|---|
|  |  |  | int hknotice = 7;//海康考勤代办 | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public interface  approveStatus{ | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static void main(String[] args) { | 
|---|
|  |  |  | System.out.println(Constants.checkCarNo("皖A10991")); | 
|---|
|  |  |  | System.out.println(Constants.checkCarNo("皖AA10991")); | 
|---|
|  |  |  | //        getChinesePingyin("DDaa江萍的对对对"); | 
|---|
|  |  |  | //        System.out.println(DateUtil.getShortTime(new Date())); | 
|---|
|  |  |  | //        System.out.println( "2025-01-14 10:50:56".substring(0,10)); | 
|---|
|  |  |  | //        System.out.println(Constants.checkCarNo("皖AA10991")); | 
|---|
|  |  |  | //        System.out.println(Constants.getVehiclePlateNo("湘B140D17").getDescription()); | 
|---|
|  |  |  | //        System.out.println(Constants.getVehiclePlateNo("宿AP0637").getDescription()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | System.out.println("<script> SELECT \n" + | 
|---|
|  |  |  | "t1.REALNAME `REALNAME`,\n" + | 
|---|
|  |  |  | "MAX(t1.`01`) `januaryCount`,\n" + | 
|---|
|  |  |  | "MAX(t1.`02`) `februaryCount`,\n" + | 
|---|
|  |  |  | "MAX(t1.`03`) `marchCount`,\n" + | 
|---|
|  |  |  | "MAX(t1.`04`) `aprilCount`,\n" + | 
|---|
|  |  |  | "MAX(t1.`05`) `mayCount`,\n" + | 
|---|
|  |  |  | "MAX(t1.`06`) `juneCount`,\n" + | 
|---|
|  |  |  | "MAX(t1.`07`) `julyCount`,\n" + | 
|---|
|  |  |  | "MAX(t1.`08`) `augustCount`,\n" + | 
|---|
|  |  |  | "MAX(t1.`09`) `septemberCount`,\n" + | 
|---|
|  |  |  | "MAX(t1.`10`) `octoberCount`,\n" + | 
|---|
|  |  |  | "MAX(t1.`11`) `novemberCount`,\n" + | 
|---|
|  |  |  | "MAX(t1.`12`) `decemberCount`\n" + | 
|---|
|  |  |  | "FROM(\n" + | 
|---|
|  |  |  | "SELECT \n" + | 
|---|
|  |  |  | "t.id,\n" + | 
|---|
|  |  |  | "t.REALNAME,\n" + | 
|---|
|  |  |  | "CASE  WHEN t.yue='01' THEN t.c ELSE 0 END AS `01`,\n" + | 
|---|
|  |  |  | "CASE  WHEN t.yue='02' THEN t.c ELSE 0 END AS `02`,\n" + | 
|---|
|  |  |  | "CASE  WHEN t.yue='03' THEN t.c ELSE 0 END AS `03`,\n" + | 
|---|
|  |  |  | "CASE  WHEN t.yue='04' THEN t.c ELSE 0 END AS `04`,\n" + | 
|---|
|  |  |  | "CASE  WHEN t.yue='05' THEN t.c ELSE 0 END AS `05`,\n" + | 
|---|
|  |  |  | "CASE  WHEN t.yue='06' THEN t.c ELSE 0 END AS `06`,\n" + | 
|---|
|  |  |  | "CASE  WHEN t.yue='07' THEN t.c ELSE 0 END AS `07`,\n" + | 
|---|
|  |  |  | "CASE  WHEN t.yue='08' THEN t.c ELSE 0 END AS `08`,\n" + | 
|---|
|  |  |  | "CASE  WHEN t.yue='09' THEN t.c ELSE 0 END AS `09`,\n" + | 
|---|
|  |  |  | "CASE  WHEN t.yue='10' THEN t.c ELSE 0 END AS `10`,\n" + | 
|---|
|  |  |  | "CASE  WHEN t.yue='11' THEN t.c ELSE 0 END AS `11`,\n" + | 
|---|
|  |  |  | "CASE  WHEN t.yue='12' THEN t.c ELSE 0 END AS `12`  \n" + | 
|---|
|  |  |  | "FROM   \n" + | 
|---|
|  |  |  | "(SELECT \n" + | 
|---|
|  |  |  | "su.id,\n" + | 
|---|
|  |  |  | "su.REALNAME,\n" + | 
|---|
|  |  |  | "DATE_FORMAT(b.START_TIME,'%m') yue,\n" + | 
|---|
|  |  |  | "SUM(" + | 
|---|
|  |  |  | "CONVERT( (UNIX_TIMESTAMP(b.END_TIME) - UNIX_TIMESTAMP(b.START_TIME))/(60*60), DECIMAL(5,1))) c\n" + | 
|---|
|  |  |  | "FROM \n" + | 
|---|
|  |  |  | "meeting_user_rel ur\n" + | 
|---|
|  |  |  | "LEFT JOIN `SYSTEM_USER` su ON ur.USER_ID = su.id \n" + | 
|---|
|  |  |  | "LEFT JOIN meeting_book b ON ur.OBJ_ID = b.id \n" + | 
|---|
|  |  |  | "WHERE DATE_FORMAT(b.START_TIME,'%Y') = #{yearNum} AND b.STATUS in(0,2) and b.isdeleted=0" + | 
|---|
|  |  |  | "<if test='userId != null'>"+ | 
|---|
|  |  |  | "and ur.USER_ID = #{userId}\n" + | 
|---|
|  |  |  | "</if>"+ | 
|---|
|  |  |  | "GROUP BY su.id, DATE_FORMAT(b.START_TIME,'%m')) t) t1 GROUP BY t1.id" + | 
|---|
|  |  |  | "</script>"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | LW_FK(0,"劳务访客"), | 
|---|
|  |  |  | PT_FK(1,"普通访客"), | 
|---|
|  |  |  | NB_FK(2,"内部人员"), | 
|---|
|  |  |  |  | 
|---|
|  |  |  | COMPANY_TYPE_REL(0,"相关方组织"), | 
|---|
|  |  |  | COMPANY_TYPE_INTERNAL(1,"内部人员"), | 
|---|
|  |  |  | COMPANY_TYPE_FK(3,"访客"), | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** 进场类型 **/ | 
|---|
|  |  |  | OUT(0,"出"), | 
|---|
|  |  |  | 
|---|
|  |  |  | this.info = info; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public static String getChinesePingyin(String chinese) { | 
|---|
|  |  |  | if(StringUtils.isBlank(chinese)){ | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | StringBuilder result = new StringBuilder(); | 
|---|
|  |  |  | for (char ch : chinese.toCharArray()) { | 
|---|
|  |  |  | String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(ch); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 如果字符是中文,则获取其拼音的首字母 | 
|---|
|  |  |  | if (pinyinArray != null && pinyinArray.length > 0) { | 
|---|
|  |  |  | result.append(pinyinArray[0].charAt(0)); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // 非中文字符直接拼接 | 
|---|
|  |  |  | result.append(ch); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | System.out.println(result.toString()); | 
|---|
|  |  |  | return result.toString().toUpperCase(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 月台作业 状态 | 
|---|
|  |  |  | 
|---|
|  |  |  | IMPORT_TRAIMETIME(14, "导入培训有效","由【${param1}】于【${param2}】,进行【导入培训有效】操作" ), | 
|---|
|  |  |  | BE_HEAD(15, "设为主管","由【${param1}】于【${param2}】,进行【设为主管】操作" ), | 
|---|
|  |  |  | NOT_HEAD(16, "取消主管","由【${param1}】于【${param2}】,进行【取消主管】操作" ), | 
|---|
|  |  |  | MEET_BOOK_DEL(17, "删除会议室申请","由【${param1}】于【${param2}】,进行【删除会议室申请】操作,对象信息${param3}" ), | 
|---|
|  |  |  | VISIT_DEL(18, "删除访客申请","由【${param1}】于【${param2}】,进行【删除访客申请】,对象信息:${param3}" ), | 
|---|
|  |  |  | VISIT_CAR_DEL(19, "删除访客报备","由【${param1}】于【${param2}】,进行【删除访客报备】,对象信息:${param3}" ), | 
|---|
|  |  |  | PLATFROM_BOOK_DEL(20, "删除月台预约任务","由【${param1}】于【${param2}】,进行【删除月台预约任务】,对象信息:${param3}"  ), | 
|---|
|  |  |  | CAR_BOOK_DEL(21, "删除公车申请","由【${param1}】于【${param2}】,进行【删除公车申请】,对象信息:${param3}"), | 
|---|
|  |  |  | PLATFROM_JOB_DEL(22, "删除安泰物流作业任务","由【${param1}】于【${param2}】,进行【删除安泰物流作业任务】,对象信息:${param3}"  ), | 
|---|
|  |  |  | HIDEN_DANGER_DEL(23, "删除隐患随手拍","由【${param1}】于【${param2}】,进行【删除隐患随手拍】,对象信息:${param3}"), | 
|---|
|  |  |  | ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 成员变量 | 
|---|
|  |  |  | 
|---|
|  |  |  | HIDDEN_DANGER_SUBMIT(0, "隐患随手拍提报", "隐患随手拍提报"), | 
|---|
|  |  |  | HIDDEN_DANGER_DEAL_BEFORE(1, "隐患随手拍处理前", "隐患随手拍处理前"), | 
|---|
|  |  |  | HIDDEN_DANGER_DEAL_AFTER(2, "隐患随手拍处理后 ", "隐患随手拍处理后 "), | 
|---|
|  |  |  | MEETING_BOOKS(4, "会议文件 ", "会议文件 "), | 
|---|
|  |  |  | ; | 
|---|
|  |  |  | // 成员变量 | 
|---|
|  |  |  | private String name; | 
|---|