|  |  |  | 
|---|
|  |  |  | package com.doumee.core.utils; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.doumee.core.constants.ResponseStatus; | 
|---|
|  |  |  | import com.doumee.core.exception.BusinessException; | 
|---|
|  |  |  | import com.doumee.dao.business.vo.UnitCodeVo; | 
|---|
|  |  |  | 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 okhttp3.OkHttpClient; | 
|---|
|  |  |  | import okhttp3.Request; | 
|---|
|  |  |  | import okhttp3.Response; | 
|---|
|  |  |  | import org.apache.commons.collections4.CollectionUtils; | 
|---|
|  |  |  | import org.apache.commons.lang3.StringUtils; | 
|---|
|  |  |  | import org.apache.http.client.methods.CloseableHttpResponse; | 
|---|
|  |  |  | import org.apache.http.client.methods.HttpGet; | 
|---|
|  |  |  | import org.apache.http.client.utils.URIBuilder; | 
|---|
|  |  |  | import org.apache.http.impl.client.CloseableHttpClient; | 
|---|
|  |  |  | import org.apache.http.impl.client.HttpClients; | 
|---|
|  |  |  | import org.apache.http.util.EntityUtils; | 
|---|
|  |  |  | import org.jsoup.Jsoup; | 
|---|
|  |  |  | import org.jsoup.nodes.Document; | 
|---|
|  |  |  | import org.jsoup.nodes.Element; | 
|---|
|  |  |  | import org.jsoup.select.Elements; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.io.ByteArrayInputStream; | 
|---|
|  |  |  | import java.io.ByteArrayOutputStream; | 
|---|
|  |  |  | import java.io.IOException; | 
|---|
|  |  |  | import java.io.InputStream; | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.net.URI; | 
|---|
|  |  |  | import java.net.URLDecoder; | 
|---|
|  |  |  | import java.text.SimpleDateFormat; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.Arrays; | 
|---|
|  |  |  | import  java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Random; | 
|---|
|  |  |  | import java.util.regex.Matcher; | 
|---|
|  |  |  | import java.util.regex.Pattern; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | public static final String HK_PUSH_URL = "HK_PUSH_URL"; | 
|---|
|  |  |  | public static final String HK_ROOTORG_CODE ="HK_ROOTORG_CODE" ; | 
|---|
|  |  |  | public static final String HK_ROOTORG_NAME ="HK_ROOTORG_NAME" ; | 
|---|
|  |  |  | public static final String REDIS_TOKEN_KEY = "token_"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //被拜访人信息校验方式(0手机号单独校验 1手机号和姓名组合校验) | 
|---|
|  |  |  | public static final String ZBOM_CRM_AUTH_API_KEY = "ZBOM_CRM_AUTH_API_KEY"; | 
|---|
|  |  |  | 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 SELECT_DOORS_VISIT_REQUIRED = "SELECT_DOORS_VISIT_REQUIRED"; | 
|---|
|  |  |  | 
|---|
|  |  |  | public static final String FILE_DIR = ""; | 
|---|
|  |  |  | public static final String INITIAL_PASSWORD = "INITIAL_PASSWORD"; | 
|---|
|  |  |  | public static final String VALIDATE_VISIT = "VALIDATE_VISIT"; | 
|---|
|  |  |  | public static final String PLATFORM = "mp-weixin"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 访客来访配置 | 
|---|
|  |  |  | public static final String VISIT_CONFIG = "VISIT_CONFIG"; | 
|---|
|  |  |  | 
|---|
|  |  |  | public static final String FTP_USERNAME ="FTP_USERNAME" ; | 
|---|
|  |  |  | public static final String FTP_PWD ="FTP_PWD" ; | 
|---|
|  |  |  | public static final String FTP_RESOURCE_PATH ="FTP_RESOURCE_PATH" ; | 
|---|
|  |  |  | public static final String ERP_ORGLIST_URL ="ERP_ORGLIST_URL" ; | 
|---|
|  |  |  | public static final String ERP_USERLIST_URL ="ERP_USERLIST_URL" ; | 
|---|
|  |  |  | public static final String ERP_APPROVE_URL ="ERP_APPROVE_URL" ; | 
|---|
|  |  |  | public static final String ERP_USERSTATUS_RL ="ERP_USERSTATUS_RL" ; | 
|---|
|  |  |  | public static final String ERP ="ERP" ; | 
|---|
|  |  |  | public static final Integer THREE =3 ; | 
|---|
|  |  |  | public static final Integer FOUR =4 ; | 
|---|
|  |  |  | 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  boolean DEALING_HK_SYNCPRIVILEGE= false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_SYNCDEVICE = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_SYNCDEVICE_STATUS = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_SYNCPARK = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_IMG = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_ORG = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_USER = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_DEL_USER = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_VISIT = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_VISIT_EXPIRE = false; | 
|---|
|  |  |  | public static  boolean DEALING_FROM_HK_VISIT = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_EMPOWER = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_EMPOWER_DETAIL = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_EMPOWER_RESULT = false; | 
|---|
|  |  |  | public static  boolean DEALING_HK_PARKBOOK = false; | 
|---|
|  |  |  | // ERP接口配置 | 
|---|
|  |  |  | public static final String ERP_CONFIG = "ERP_CONFIG"; | 
|---|
|  |  |  | // ERP ACCESS_KEY | 
|---|
|  |  |  | public static final String ERP_ACCESS_KEY = "ERP_ACCESS_KEY"; | 
|---|
|  |  |  | // ERP ACCESS_SECRET | 
|---|
|  |  |  | public static final String ERP_ACCESS_SECRET = "ERP_ACCESS_SECRET"; | 
|---|
|  |  |  | public static final String UNIT_CODE = "UNIT_CODE" ; | 
|---|
|  |  |  | public static final String ZBOM = "ZBOM" ; | 
|---|
|  |  |  | public static final String ZBOM_IAM_APPKEY = "ZBOM_IAM_APPKEY"; | 
|---|
|  |  |  | public static final String ZBOM_IAM_APPID = "ZBOM_IAM_APPID"; | 
|---|
|  |  |  | public static final String ZBOM_PAD_INTERFACE_KEY = "ZBOM_PAD_INTERFACE_KEY"; | 
|---|
|  |  |  | public static final String USER_CARD_HEADER_IMG ="USER_CARD_HEADER_IMG" ; | 
|---|
|  |  |  | public static final String USER_CARD_PHONE_IMG ="USER_CARD_PHONE_IMG" ; | 
|---|
|  |  |  | public static final String USER_CARD_ADDR_IMG ="USER_CARD_ADDR_IMG" ; | 
|---|
|  |  |  | public static final String USER_CARD_SHOP_IMG ="USER_CARD_SHOP_IMG" ; | 
|---|
|  |  |  | public static final String USER_CARD_LOGO_IMG ="USER_CARD_LOGO_IMG" ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 内部人员冻结配置时间 | 
|---|
|  |  |  | public static final String TIMEOUT_FREEZE = "TIMEOUT_FREEZE"; | 
|---|
|  |  |  | public static Integer parseIntByStr(String idtOrgStatus) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | return  Integer.parseInt(idtOrgStatus); | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 超时预警配置 | 
|---|
|  |  |  | public static final String TIMEOUT_WARNING = "TIMEOUT_WARNING"; | 
|---|
|  |  |  | // FTP文件服务器资源访问地址 | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 附件对象类型 0news多图 1news视频 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public  enum MultiFile{ | 
|---|
|  |  |  | NEWS_FILE(0, "推广资讯附件", "NEWS") | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ; | 
|---|
|  |  |  | // 成员变量 | 
|---|
|  |  |  | private String name; | 
|---|
|  |  |  | private int key; | 
|---|
|  |  |  | private String info;// 描述 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 构造方法 | 
|---|
|  |  |  | MultiFile(int key, String name, String info) { | 
|---|
|  |  |  | this.name = name; | 
|---|
|  |  |  | this.key = key; | 
|---|
|  |  |  | this.info = info; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 普通方法 | 
|---|
|  |  |  | public static String getName(int index) { | 
|---|
|  |  |  | for (MultiFile c : MultiFile.values()) { | 
|---|
|  |  |  | if (c.getKey() == index) { | 
|---|
|  |  |  | return c.name; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 普通方法 | 
|---|
|  |  |  | public static String getInfo(int index) { | 
|---|
|  |  |  | for (MultiFile c : MultiFile.values()) { | 
|---|
|  |  |  | if (c.getKey() == index) { | 
|---|
|  |  |  | return c.info; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getInfo() { | 
|---|
|  |  |  | return info; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setInfo(String info) { | 
|---|
|  |  |  | this.info = info; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // get set 方法 | 
|---|
|  |  |  | public String getName() { | 
|---|
|  |  |  | return name; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setName(String name) { | 
|---|
|  |  |  | this.name = name; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public int getKey() { | 
|---|
|  |  |  | return key; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setKey(int key) { | 
|---|
|  |  |  | this.key = key; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static  Date  getBirthdyByCardNo(String idCard){ | 
|---|
|  |  |  | if(idCard ==null || idCard.length()<14){ | 
|---|
|  |  |  | 
|---|
|  |  |  | *   判断是否为有效车牌号 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static boolean checkCarNo(String str) { | 
|---|
|  |  |  | //        String patt="^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵川青藏琼宁秦川]\\\\d{5}[A-Z]$"; | 
|---|
|  |  |  | //        String patt="^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵川青藏琼宁秦川]d{5}[A-Z]$"; | 
|---|
|  |  |  | //        Pattern r = Pattern.compile(patt); | 
|---|
|  |  |  | //        Matcher matcher = r.matcher(str); | 
|---|
|  |  |  | //        String regex = "^[\u4e00-\u9fa5]{1}[A-Z]{1}[A-HJ-NP-Z]{1}[A-HJ-NP-Z0-9]{4}[D0-9X]$"; | 
|---|
|  |  |  | 
|---|
|  |  |  | public static final String ACCESS_ID="ACCESS_ID"; | 
|---|
|  |  |  | public static final String BUCKETNAME = "BUCKETNAME"; | 
|---|
|  |  |  | public static final String OBJCET_STORAGE = "OBJCET_STORAGE"; | 
|---|
|  |  |  | public static final String ZBOM_CUSTOMIZED = "ZBOM_CUSTOMIZED"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static final String ACCESS_KEY = "ACCESS_KEY"; | 
|---|
|  |  |  | public static final String ENDPOINT = "ENDPOINT"; | 
|---|
|  |  |  | public static final String RESOURCE_PATH = "RESOURCE_PATH"; | 
|---|
|  |  |  | public static final String WEIXIN_DEFAULT_IMGS = "WEIXIN_DEFAULT_IMGS"; | 
|---|
|  |  |  | public static final String USER_CARD_DEFAULT_IMG = "USER_CARD_DEFAULT_IMG"; | 
|---|
|  |  |  | public static final String USERS_FILE = "USERS_FILE"; | 
|---|
|  |  |  | public static final String SHARES_FILE = "SHARES_FILE"; | 
|---|
|  |  |  | public static final String NEWS_FILE = "NEWS_FILE"; | 
|---|
|  |  |  | public static final String USER_LABEL = "USER_LABEL"; | 
|---|
|  |  |  | //发送会议开始  定时提前多少分钟发送 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static final String SYSTEM ="SYSTEM"; | 
|---|
|  |  |  | public static final String MEMBER ="MEMBER"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static final String COFFEE_BEAN_TASK ="COFFEE_BEAN_TASK"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static final String WX_PLATFORM = "WX_PLATFORM"; | 
|---|
|  |  |  | public static final String ZBOM_ZHONGTAI_API_URL = "ZBOM_ZHONGTAI_API_URL"; | 
|---|
|  |  |  | public static final String ZBOM_ZHONGTAI_SYS_API_URL = "ZBOM_ZHONGTAI_SYS_API_URL"; | 
|---|
|  |  |  | public static final String WX_PLATFORM_ACCESS_TOKEN = "WX_PLATFORM_ACCESS_TOKEN"; | 
|---|
|  |  |  | public static final String ZBOM_ENCODE_URL = "ZBOM_ENCODE_URL"; | 
|---|
|  |  |  | public static final String WX_PLATFORM_APPID = "WX_PLATFORM_APPID"; | 
|---|
|  |  |  | public static final String WX_PLATFORM_SECRET = "WX_PLATFORM_SECRET"; | 
|---|
|  |  |  | public static final String WX_PLATFORM_AUDIT_VISIT = "WX_PLATFORM_AUDIT_VISIT"; | 
|---|
|  |  |  | public static final String ZBOM_CRM_API_URL = "ZBOM_CRM_API_URL"; | 
|---|
|  |  |  | public static final String ZBOM_CRM_API_KEY = "ZBOM_CRM_API_KEY"; | 
|---|
|  |  |  | public static final String ZBOM_SMS_API_KEY = "ZBOM_SMS_API_KEY"; | 
|---|
|  |  |  | public static final String ZBOM_IAM_API_URL = "ZBOM_IAM_API_URL"; | 
|---|
|  |  |  | public static final String ZBOM_SMS_API_URL = "ZBOM_SMS_API_URL"; | 
|---|
|  |  |  | public static final String WX_PLATFORM_PREFIX = "WX_PLATFORM_PREFIX"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static final String WX_MINI_CONFIG = "WX_MINI_CONFIG"; | 
|---|
|  |  |  | public static final String SHARE_HAIBAO_HEADER_TITLE = "SHARE_HAIBAO_HEADER_TITLE"; | 
|---|
|  |  |  | public static final String WX_APPID_CUSTOMER = "WX_APPID_CUSTOMER"; | 
|---|
|  |  |  | public static final String WX_SECRET_CUSTOMER = "WX_SECRET_CUSTOMER"; | 
|---|
|  |  |  | public static final String WX_APPID_PERSONNEL = "WX_APPID_PERSONNEL"; | 
|---|
|  |  |  | public static final String WX_SECRET_PERSONNEL = "WX_SECRET_PERSONNEL"; | 
|---|
|  |  |  | public static final String WX_TOKEN_CUSTOMER = "WX_TOKEN_CUSTOMER"; | 
|---|
|  |  |  | public static final String WX_TOKEN_PERSONNEL = "WX_TOKEN_PERSONNEL"; | 
|---|
|  |  |  | public static final String ZBOM_CRM_POSTCUS_API_KEY  = "ZBOM_CRM_POSTCUS_API_KEY"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public interface RedisKeys { | 
|---|
|  |  |  | public static final String IMPORTING_MEMBER ="IMPORTING_MEMBER"; | 
|---|
|  |  |  | public static final String IMPORTING_SHOP ="IMPORTING_SHOP"; | 
|---|
|  |  |  | public static final String SHOP_TREE ="SHOP_TREE"; | 
|---|
|  |  |  | public static final String ERP_TOKEN ="ERP_TOKEN"; | 
|---|
|  |  |  | public static final long EXPIRE_TIME = 7200; | 
|---|
|  |  |  | String IMPORTING_MEMBER ="IMPORTING_MEMBER"; | 
|---|
|  |  |  | String IMPORTING_SHOP ="IMPORTING_SHOP"; | 
|---|
|  |  |  | String IMPORTING_USERS ="IMPORTING_USERS"; | 
|---|
|  |  |  | String IAM_APPID ="IAM_APPID"; | 
|---|
|  |  |  | String ZBOM_CRM_API_KEY ="ZBOM_CRM_API_KEY"; | 
|---|
|  |  |  | String ZBOM_CRM_AUTH_API_KEY ="ZBOM_CRM_AUTH_API_KEY"; | 
|---|
|  |  |  | String ZBOM_CRM_API_URL ="ZBOM_CRM_API_URL"; | 
|---|
|  |  |  | String ZBOM_ENCODE_URL ="ZBOM_ENCODE_URL"; | 
|---|
|  |  |  | String ZBOM_SMS_API_KEY ="ZBOM_SMS_API_KEY"; | 
|---|
|  |  |  | String ZBOM_ZHONGTAI_API_URL ="ZBOM_ZHONGTAI_API_URL"; | 
|---|
|  |  |  | String ZBOM_ZHONGTAI_SYS_API_URL ="ZBOM_ZHONGTAI_SYS_API_URL"; | 
|---|
|  |  |  | String ZBOM_CRM_POSTCUS_API_KEY ="ZBOM_CRM_POSTCUS_API_KEY"; | 
|---|
|  |  |  | String ZBOM_AREA_REDIS_KEY ="ZBOM_AREA_REDIS_KEY"; | 
|---|
|  |  |  | String ZBOM_SMS_API_URL ="ZBOM_SMS_API_URL"; | 
|---|
|  |  |  | String IAM_APPKEY ="IAM_APPKEY"; | 
|---|
|  |  |  | String SHOP_TREE ="SHOP_TREE"; | 
|---|
|  |  |  | String ERP_TOKEN ="ERP_TOKEN"; | 
|---|
|  |  |  | long EXPIRE_TIME = 7200; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static final String INTERNAL_TOKEN ="INTERNAL_TOKEN"; | 
|---|
|  |  |  | String INTERNAL_TOKEN ="INTERNAL_TOKEN"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static final String GOODSORDER_KEY = "ordercode_"; | 
|---|
|  |  |  | public static final String ACTIVITY_SIGN_KEY = "actcode_"; | 
|---|
|  |  |  | public static final String AFTERSALE_KEY = "salecode_"; | 
|---|
|  |  |  | String GOODSORDER_KEY = "ordercode_"; | 
|---|
|  |  |  | String ACTIVITY_SIGN_KEY = "actcode_"; | 
|---|
|  |  |  | String AFTERSALE_KEY = "salecode_"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static boolean equalsLong(Long a, Long b) { | 
|---|
|  |  |  | if (a == null || b==null) { | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return a.equals(b); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | public static boolean equalsInteger(Integer a, Integer b) { | 
|---|
|  |  |  | if (formatIntegerNum(a) == formatIntegerNum(b)) { | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | 
|---|
|  |  |  | int otherDeal = 4;//他人已处理 | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 根据配置处理房屋户型信息 | 
|---|
|  |  |  | * @param layout | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public static String getHouseLayout(String layout){ | 
|---|
|  |  |  | if(StringUtils.isBlank(layout)){ | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String [] arr = layout.split("-"); | 
|---|
|  |  |  | StringBuffer stringBuffer = new StringBuffer(); | 
|---|
|  |  |  | for (int i = 0; i < arr.length; i++) { | 
|---|
|  |  |  | if(i==0){ | 
|---|
|  |  |  | stringBuffer.append( i + "室"); | 
|---|
|  |  |  | }else if(i==1){ | 
|---|
|  |  |  | stringBuffer.append( i + "厅"); | 
|---|
|  |  |  | }else if(i==2){ | 
|---|
|  |  |  | stringBuffer.append( i + "厨"); | 
|---|
|  |  |  | }else if(i==3){ | 
|---|
|  |  |  | stringBuffer.append( i + "卫"); | 
|---|
|  |  |  | }else if(i==4){ | 
|---|
|  |  |  | stringBuffer.append( i + "阳"); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return stringBuffer.toString(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 获取车牌类型信息 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static String desensitizationPhone(String phone)  { | 
|---|
|  |  |  | return phone.replaceAll("(d{3})d{4}(d{4})", "$1****$2"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public enum VehiclePlateNoEnum { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static void main(String[] args) { | 
|---|
|  |  |  | System.out.println((DESUtil.decrypt(Constants.EDS_PWD, "En35O2o+Mpw5bThqkT8lmE6UPG+W6LFs"))); | 
|---|
|  |  |  | //        System.out.println(Constants.getVehiclePlateNo("湘B140D17").getDescription()); | 
|---|
|  |  |  | //        System.out.println(Constants.getVehiclePlateNo("宿AP0637").getDescription()); | 
|---|
|  |  |  | getImgsFromHtmlText("<p><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/40627809-6058-428c-b02a-6715d7b1735a.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/8d9d1737-43c0-4628-a982-ed0832b65464.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/8aacf1bb-5bf0-46dc-bd25-a4f335078711.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/5d5e5af4-fd4e-402f-81d1-e0cc498d55d4.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/4632b61b-0de2-4f73-8b54-f4d6aa3de2db.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/a9eb1a9c-23c7-48aa-9103-cd697158db75.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/a0004771-d606-46fe-b872-07640ee1695a.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/d437bacb-ec87-404e-baa4-a6c040c35216.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/b2c61dc9-fdce-42b1-97d1-12cb993ae8cf.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/e8e27d17-61b0-4035-b229-9ba1c73869eb.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/7f43615d-079e-4133-9e5f-3a1fd19090b8.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/75274ffb-100f-4016-8352-20da9003f192.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/6810dd81-a6bc-4140-bfd7-d9c3e51c2439.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/0dfab735-0a05-47ef-aaa9-728510ad1d2f.jpg\" title=\"\" alt=\"\"/><img src=\"https://osswebcdn.zbom.com//zbkitchen/20240423/ca3b095f-17f2-439b-9cd3-10fe60257dd9.jpg\" title=\"\" alt=\"\"/></p>"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | return reqJson; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static String getRandom6Num( ) { | 
|---|
|  |  |  | Random random = new Random(); | 
|---|
|  |  |  | StringBuilder sb = new StringBuilder(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (int i = 0; i < 6; i++) { | 
|---|
|  |  |  | int digit = random.nextInt(10); | 
|---|
|  |  |  | sb.append(digit); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return sb.toString(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static InputStream generateWxMiniImgStream(String accessToken,String scene,String page) { | 
|---|
|  |  |  | //生成图片上传OSS | 
|---|
|  |  |  | Map<String,Object> body = new HashMap<>(); | 
|---|
|  |  |  | // 场景码,与前端约定,最终是需要前端解析 | 
|---|
|  |  |  | body.put("scene", scene); | 
|---|
|  |  |  | // 正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。 | 
|---|
|  |  |  | String env_version = "trial"; | 
|---|
|  |  |  | body.put("env_version", env_version); | 
|---|
|  |  |  | if(env_version.equals("release")&&StringUtils.isNotBlank(page)){ | 
|---|
|  |  |  | body.put("page", page); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 透明,根据你的场景自行设置body参数 | 
|---|
|  |  |  | body.put("is_hyaline", true); | 
|---|
|  |  |  | OkHttpClient client = new OkHttpClient().newBuilder().build(); | 
|---|
|  |  |  | okhttp3.MediaType mediaType = okhttp3.MediaType.parse("application/json"); | 
|---|
|  |  |  | okhttp3.RequestBody requestBody = okhttp3.RequestBody.create(mediaType, JSONObject.toJSONString(body)); | 
|---|
|  |  |  | Request request = new Request.Builder().url("https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="+accessToken) | 
|---|
|  |  |  | .method("POST", requestBody).build(); | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | Response response = client.newCall(request).execute(); | 
|---|
|  |  |  | if (response.isSuccessful()) { | 
|---|
|  |  |  | InputStream inputStream = new ByteArrayInputStream(response.body().bytes()); | 
|---|
|  |  |  | /*ByteArrayOutputStream baos = new ByteArrayOutputStream(); | 
|---|
|  |  |  | byte[] buffer = new byte[1024]; | 
|---|
|  |  |  | int len = -1; | 
|---|
|  |  |  | while ((len = inputStream.read(buffer)) != -1) { | 
|---|
|  |  |  | baos.write(buffer, 0, len); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | System.out.println("data:mediatype;base64," + Base64.getEncoder().encodeToString(baos.toByteArray()));*/ | 
|---|
|  |  |  | return inputStream; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return  null; | 
|---|
|  |  |  | //        throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"生成图片失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public  static  List<String>   getImgsFromHtmlText(String content) { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | if(StringUtils.isNotBlank(content)){ | 
|---|
|  |  |  | List<String> urls = new ArrayList<>(); | 
|---|
|  |  |  | Document doc = Jsoup.parse(content); | 
|---|
|  |  |  | Elements imgElements = doc.select("img[src]"); | 
|---|
|  |  |  | for (Element imgElement : imgElements) { | 
|---|
|  |  |  | String imgUrl = imgElement.attr("src"); | 
|---|
|  |  |  | System.out.println(imgUrl); | 
|---|
|  |  |  | urls.add(imgUrl); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return urls; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }catch (Exception e){ | 
|---|
|  |  |  | e.printStackTrace(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return  new ArrayList<>(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|