|  |  |  | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 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 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"; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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"; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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"))); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Map<String,String> map = new HashMap<>(); | 
|---|
|  |  |  | map.put("101","志邦本部"); | 
|---|
|  |  |  | map.put("102","制造事业部"); | 
|---|
|  |  |  | map.put("103","肥东销售公司"); | 
|---|
|  |  |  | map.put("104","ZB/志邦厨柜"); | 
|---|
|  |  |  | map.put("105","商品事业部"); | 
|---|
|  |  |  | map.put("106","巢湖销售公司"); | 
|---|
|  |  |  | map.put("107","IK/全屋定制"); | 
|---|
|  |  |  | map.put("108","工程事业部"); | 
|---|
|  |  |  | map.put("109","合肥销售公司"); | 
|---|
|  |  |  | map.put("110","外贸事业部"); | 
|---|
|  |  |  | map.put("111","志邦家居公司"); | 
|---|
|  |  |  | map.put("112","ZB/志邦衣柜"); | 
|---|
|  |  |  | map.put("127","志邦厨柜股份有限公司"); | 
|---|
|  |  |  | map.put("141","合肥志邦木业有限公司"); | 
|---|
|  |  |  | map.put("161","ZB/志邦木门"); | 
|---|
|  |  |  | map.put("263","国贸公司"); | 
|---|
|  |  |  | List<UnitCodeVo> list = new ArrayList<>(); | 
|---|
|  |  |  | Iterator<Map.Entry<String, String>> iterator = map.entrySet().iterator(); | 
|---|
|  |  |  | while (iterator.hasNext()) { | 
|---|
|  |  |  | Map.Entry<String, String> entry = iterator.next(); | 
|---|
|  |  |  | UnitCodeVo m = new UnitCodeVo(); | 
|---|
|  |  |  | m.setCode(entry.getKey()); | 
|---|
|  |  |  | m.setName(entry.getValue()); | 
|---|
|  |  |  | list.add(m); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | System.out.println(JSONObject.toJSONString(list)); | 
|---|
|  |  |  | 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>"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | // 场景码,与前端约定,最终是需要前端解析 | 
|---|
|  |  |  | body.put("scene", scene); | 
|---|
|  |  |  | // 正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。 | 
|---|
|  |  |  | body.put("env_version", "develop"); | 
|---|
|  |  |  | body.put("page", page); | 
|---|
|  |  |  | 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(); | 
|---|
|  |  |  | 
|---|
|  |  |  | Response response = client.newCall(request).execute(); | 
|---|
|  |  |  | if (response.isSuccessful()) { | 
|---|
|  |  |  | InputStream inputStream = new ByteArrayInputStream(response.body().bytes()); | 
|---|
|  |  |  | /*      ByteArrayOutputStream baos = new ByteArrayOutputStream(); | 
|---|
|  |  |  | /*ByteArrayOutputStream baos = new ByteArrayOutputStream(); | 
|---|
|  |  |  | byte[] buffer = new byte[1024]; | 
|---|
|  |  |  | int len = -1; | 
|---|
|  |  |  | while ((len = inputStream.read(buffer)) != -1) { | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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<>(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|