From b2d360d9113b6955287108ca9e90d76a1f3c1419 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期日, 29 九月 2024 15:05:11 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia

---
 server/service/src/main/java/com/doumee/core/utils/Constants.java |  202 +++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 157 insertions(+), 45 deletions(-)

diff --git a/server/service/src/main/java/com/doumee/core/utils/Constants.java b/server/service/src/main/java/com/doumee/core/utils/Constants.java
index 95372cc..5c23d53 100644
--- a/server/service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -2,16 +2,35 @@
 
 
 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.*;
@@ -40,6 +59,7 @@
     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";
@@ -53,6 +73,7 @@
     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";
@@ -88,6 +109,12 @@
     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 Integer parseIntByStr(String idtOrgStatus) {
         try {
@@ -194,7 +221,7 @@
      *   鍒ゆ柇鏄惁涓烘湁鏁堣溅鐗屽彿
      */
     public static boolean checkCarNo(String str) {
-//        String patt="^[浜触娌笣鍐�璞簯杈介粦婀樼殩椴佹柊鑻忔禉璧i剛妗傜敇鏅嬭挋闄曞悏闂借吹宸濋潚钘忕惣瀹佺Е宸漖\\\\d{5}[A-Z]$";
+//        String patt="^[浜触娌笣鍐�璞簯杈介粦婀樼殩椴佹柊鑻忔禉璧i剛妗傜敇鏅嬭挋闄曞悏闂借吹宸濋潚钘忕惣瀹佺Е宸漖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]$";
@@ -300,12 +327,19 @@
     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 USERS_MANAGE_CODE = "USERS_MANAGE_CODE";
     //鍙戦�佷細璁紑濮�  瀹氭椂鎻愬墠澶氬皯鍒嗛挓鍙戦��
 
     public static final String SYSTEM ="SYSTEM";
@@ -320,7 +354,10 @@
 
 
     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";
@@ -334,26 +371,21 @@
 
 
     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 static final String ZBOM_CRM_API_URL_MP = "ZBOM_CRM_API_URL_MP";
+    public static final String ZBOM_CRM_API_URL_MP_ADDINTENTION = "ZBOM_CRM_API_URL_MP_ADDINTENTION";
+    public static final String ZBOM_CRM_API_URL_PRIVATE_KEY = "ZBOM_CRM_API_URL_PRIVATE_KEY";
+    public static final String ZBOM_CRM_API_URL_INIT_VECTOR = "ZBOM_CRM_API_URL_INIT_VECTOR";
+    public static final String ZBOM_IAM_CUSTOMER_APPID = "ZBOM_IAM_CUSTOMER_APPID";
+    public static final String ZBOM_IAM_BUSINESS_APPID = "ZBOM_IAM_BUSINESS_APPID";
 
-
-    public interface CrmSources{
-
-
-       String SOURCE_DKXD = "DKXD";// 浠e涓嬪崟(DKXD)
-       String SOURCE_LYSJ = "LYSJ";// 闆跺厓璁捐(LYSJ)
-       String SOURCE_ZBSJSQ = "ZBSJSQ";// 蹇楅偊璁捐鐢宠(ZBSJSQ)
-       String SOURCE_ZBDXFX = "ZBDXFX";// 蹇楅偊鐭俊鍒嗕韩(ZBDXFX)
-       String SOURCE_ZBLLJL = "ZBLLJL";// 蹇楅偊娴忚璁板綍鍒嗕韩(ZBLLJL)
-       String SOURCE_ZBWDSC = "ZBWDSC";// 蹇楅偊鎴戠殑鏀惰棌鍒嗕韩(ZBWDSC)
-       String SOURCE_ZBLYSJ = "ZBLYSJ";// 蹇楅偊闆跺厓璁捐(ZBLYSJ)
-       String SOURCE_ZBLDX = "ZBLDX";// 蹇楅偊鑰佸甫鏂�(ZBLDX)
-       String SOURCE_ZBFGCS = "ZBFGCS";// 蹇楅偊椋庢牸娴嬭瘯(ZBFGCS)
-       String SOURCE_ZBJX = "DSLX22";// 蹇楅偊瀹堕��(ZBJX)
-    }
 
     public interface RedisKeys {
        String IMPORTING_MEMBER ="IMPORTING_MEMBER";
@@ -361,8 +393,14 @@
        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";
@@ -449,6 +487,39 @@
     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( arr[i] + "瀹�");
+            }else if(i==1){
+                stringBuffer.append( arr[i] + "鍘�");
+            }else if(i==2){
+                stringBuffer.append( arr[i] + "鍘�");
+            }else if(i==3){
+                stringBuffer.append( arr[i] + "鍗�");
+            }else if(i==4){
+                stringBuffer.append( arr[i] + "闃�");
+            }else {
+                break;
+            }
+
+        }
+        return stringBuffer.toString();
+}
+
+
+
     /**
      * 鑾峰彇杞︾墝绫诲瀷淇℃伅
      *
@@ -464,6 +535,14 @@
         }
         return null;
     }
+
+    public static String desensitizationPhone(String phone)  {
+        if (phone == null || phone.length() != 11) {
+            return phone;
+        }
+        return phone.substring(0, 3) + "****" + phone.substring(7);
+    }
+
 
 
     public enum VehiclePlateNoEnum {
@@ -517,35 +596,7 @@
     }
 
     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/蹇楅偊琛f煖");
-        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>");
 
     }
 
@@ -630,4 +681,65 @@
 
         return sb.toString();
     }
+
+
+    public static InputStream generateWxMiniImgStream(String accessToken,String scene,String page) {
+        //鐢熸垚鍥剧墖涓婁紶OSS
+        Map<String,Object> body = new HashMap<>();
+        // 鍦烘櫙鐮侊紝涓庡墠绔害瀹氾紝鏈�缁堟槸闇�瑕佸墠绔В鏋�
+        body.put("scene", scene);
+        // 姝e紡鐗堜负 "release"锛屼綋楠岀増涓� "trial"锛屽紑鍙戠増涓� "develop"銆傞粯璁ゆ槸姝e紡鐗堛��
+        String env_version = "release";
+        body.put("env_version", env_version);
+//        body.put("page", "pages/index/index");
+        // 閫忔槑锛屾牴鎹綘鐨勫満鏅嚜琛岃缃産ody鍙傛暟
+        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<>();
+    }
+
+
+
 }

--
Gitblit v1.9.3