From a598218a73cc7736925517b12db6a861bd971f73 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期四, 22 一月 2026 18:18:08 +0800
Subject: [PATCH] 小程序   接口开发

---
 server/dmmall_service/src/main/java/com/doumee/core/utils/Constants.java |  141 +++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 135 insertions(+), 6 deletions(-)

diff --git a/server/dmmall_service/src/main/java/com/doumee/core/utils/Constants.java b/server/dmmall_service/src/main/java/com/doumee/core/utils/Constants.java
index 644b673..4b4ee73 100644
--- a/server/dmmall_service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/dmmall_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -1,15 +1,22 @@
 package com.doumee.core.utils;
 
+import cn.binarywang.wx.miniapp.bean.WxMaCodeLineColor;
+import com.doumee.core.wx.WxMiniConfig;
 import com.doumee.dao.business.model.Areas;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
 import java.math.BigDecimal;
 import java.net.URLDecoder;
 import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+@Slf4j
 public class Constants {
 
     public static final String[]  ALL_SPELL_LIST_FIRST = new String[]{"A", "B", "C", "D", "E", "F", "G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
@@ -77,6 +84,11 @@
     public static final String CASH_EXCHANGE_INTEGRAL_RATA = "CASH_EXCHANGE_INTEGRAL_RATA";//鐜伴噾-绉垎鍏戞崲姣斾緥锛�1鍏冨彲寰楀埌XXX绉垎锛�
 
 
+    public static final String MAIL_CONFIG = "MAIL_CONFIG";
+    public static final String FIRST_WEIGHT = "FIRST_WEIGHT";
+    public static final String CONTINUE_WEIGHT = "CONTINUE_WEIGHT";
+    public static final String FIRST_FEE = "FIRST_FEE";
+    public static final String CONTINUE_FEE = "CONTINUE_FEE";
 
 
     public static final String INITIAL_ROLE = "INITIAL_ROLE";
@@ -132,6 +144,18 @@
     public static final String COFFEE_ARTICLE_BACKGROUND = "COFFEE_ARTICLE_BACKGROUND";
 
     public static final String TRANSFER_FILE = "TRANSFER_FILE";
+
+    public static final String INVITE_RULE = "INVITE_RULE";
+
+    public static final String INVITE_IMG = "INVITE_IMG";
+
+    public static final String SHARES_FILE = "SHARES_FILE";
+
+    public static final String INVITE_IMG_URL = "INVITE_IMG_URL";
+
+
+
+
 
 
     public interface RedisKeys {
@@ -866,14 +890,14 @@
         SHOP_YEAR_SETTLEMENT(18,"绉垎杩囨湡","绉垎杩囨湡锛屾秷鑰�${param}绉垎",0,0),
 
 
-        ORDER_DONE_AMOUNT(16,"璁㈠崟缁撶畻閲戦","璁㈠崟缁撶畻閲戦",0,1),
-        WITHDRAW_APPLY(17,"鎻愮幇","鎻愮幇",0,1),
-        WITHDRAW_APPLY_BACK(19,"鎻愮幇鍙栨秷","浣欓鎻愮幇鍙栨秷閫�鍥�",0,1),
-        ORDER_DONE_AMOUNT_BACK(20,"璁㈠崟缁撶畻閫�鍥�","璁㈠崟缁撶畻閫�鍥為��鍥�",0,1),
+        ORDER_DONE_AMOUNT(16,"璁㈠崟缁撶畻","${param}璁㈠崟缁撶畻鎴愬姛锛岃幏寰楋骏${param1}鍏�",0,1),//${param}璁㈠崟缂栧彿锛�${param1}閲戦
+        WITHDRAW_APPLY(17,"浣欓鎻愮幇","浣欓鎻愮幇宸叉彁浜わ紝娑堣�楋骏${param}鍏�",0,1),
+        WITHDRAW_APPLY_BACK(19,"鎻愮幇閫�鍥�","浣欓鎻愮幇澶辫触锛岃幏寰楋骏${param}鍏�",0,1),
+        ORDER_DONE_AMOUNT_BACK(20,"璁㈠崟缁撶畻閫�鍥�","${param}璁㈠崟缁撶畻閫�鍥烇紝娑堣�楋骏${param1}鍏�",0,1),//${param}璁㈠崟缂栧彿锛�${param1}閲戦
 
 
-        SHOP_ORDER(21,"娑堣垂杩旂Н鍒�","浼氬憳${param}浜ゆ槗鎴愬姛锛岃幏寰�${param1}绉垎",0,0),
-        SHOP_ORDER_CANCEL(22,"閫�鍗曟墸闄�","浜ゆ槗閫�娆鹃��鍥烇紝娑堣��100绉垎",0,0),
+        SHOP_ORDER(21,"娑堣垂杩旂Н鍒�","浼氬憳${param}浜ゆ槗鎴愬姛锛岃幏寰�${param1}绉垎",0,0),//${param}鏄电О-鎵嬫満鍙�
+        SHOP_ORDER_CANCEL(22,"璁㈠崟鍙栨秷閫�鍥�","璁㈠崟鍙栨秷閫�鍥烇紝閫�鍥�${param}绉垎",0,0),
         SHOP_SYSTEM_RECHARGE(23,"绉垎鍙戞斁","骞冲彴濂栧姳锛岃幏寰�${param}绉垎",0,0),
         SHOP_SYSTEM_DEDUCT(24,"绉垎鎵i櫎","骞冲彴鎵e噺锛屾秷鑰�${param}绉垎",0,0),
 
@@ -966,6 +990,61 @@
 
 
     }
+
+    public enum WxNotice {
+
+        GOODSORDER_SEND(0,"鎮ㄨ喘涔扮殑鍟嗗搧銆恵param}銆戝凡鍙戣揣","/","02BlSaqsSje7IjsWy0K7HdH7ArpOsEHD14OQU2Mk2Cs"),
+        GOODSORDER_WRITEOFF(1,"鎮ㄨ喘涔扮殑鍟嗗搧銆恵param}銆戝凡鏍搁攢","/","A_-0NgHwX5a6Dlst64rqcDtcz_fGILwl3HTpN1rf7GE"),
+        GOODSORDER_REFUND(2,"鎮ㄨ喘涔扮殑鍟嗗搧銆恵param}銆戝凡閫�娆撅紝閫�娆鹃噾棰濄�愶骏{param2}銆�","/","yGwMHrXM3Qd55hdSeaKY9dLb-kfgE2Vs-8iK9kQaveI");
+
+        WxNotice(int i, String s, String s1,String s2) {
+            this.type = i;
+            this.noticeInfo = s;
+            this.jumpUrl = s1;
+            this.tempId = s2;
+        }
+
+
+        private int type;
+        private String noticeInfo; //閫氱煡淇℃伅
+        private String jumpUrl;//璺宠浆璺緞
+        private String tempId;//璺宠浆璺緞
+
+
+        public int getType() {
+            return type;
+        }
+
+        public void setType(int type) {
+            this.type = type;
+        }
+
+        public String getNoticeInfo() {
+            return noticeInfo;
+        }
+
+        public void setNoticeInfo(String noticeInfo) {
+            this.noticeInfo = noticeInfo;
+        }
+
+        public String getJumpUrl() {
+            return jumpUrl;
+        }
+
+        public void setJumpUrl(String jumpUrl) {
+            this.jumpUrl = jumpUrl;
+        }
+        public String getTempId() {
+            return tempId;
+        }
+        public void setTempId(String tempId) {
+            this.tempId = tempId;
+        }
+
+
+    }
+
+
 
 
     /**
@@ -1176,6 +1255,8 @@
 
     public  enum UserActionType {
         CHANGE_SHOP(0, "缁忛攢鍟嗘洿鎹�","鐢便��${param1}銆戜簬銆�${param2}銆戯紝杩涜銆愮粡閿�鍟嗘洿鎹€��" ),
+        CHANGE_SALETYPE(1, "缁忛攢鍟嗘洿鎹㈤攢鍞ā寮�","鐢便��${param1}銆戜簬銆�${param2}銆戯紝杩涜銆愰攢鍞ā寮忓彉鏇淬��" ),
+        CHANGE_ORDER_KD(2, "璁㈠崟蹇�掓洿鎹�","鐢便��${param1}銆戜簬銆�${param2}銆戯紝杩涜銆愯鍗曞揩閫掓洿鎹€��;${param3}" ),
         ;
 
         // 鎴愬憳鍙橀噺
@@ -1222,4 +1303,52 @@
             this.info = info;
         }
     }
+
+
+    public static InputStream generateWxMiniImgStream(String scene, String page, boolean isUsePage) {
+        //鐢熸垚鍥剧墖涓婁紶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);
+        if(isUsePage){
+            body.put("page", page);
+        }
+        //body.put("page", "pages/index/index");
+        // 閫忔槑锛屾牴鎹綘鐨勫満鏅嚜琛岃缃産ody鍙傛暟
+        body.put("is_hyaline", true);
+        try {
+            WxMaCodeLineColor codeLineColor = new WxMaCodeLineColor("0","0","0");
+            byte[]  bytes =  WxMiniConfig.wxMaService.getQrcodeService().createWxaCodeUnlimitBytes
+                    (scene,null,false,env_version,300,false,codeLineColor,false);
+            if (bytes !=null) {
+                InputStream inputStream = new ByteArrayInputStream(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()));*/
+                log.error("鐢熸垚灏忕▼搴忕爜鎴愬姛:============"+inputStream.available());
+                return inputStream;
+            }else{
+                log.error("鐢熸垚灏忕▼搴忕爜澶辫触:============");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("鐢熸垚灏忕▼搴忕爜澶辫触:============"+e.getMessage());
+        }
+        return  null;
+    }
+
+
+    public static Integer getInviteCode(String inviteStr){
+        if(StringUtils.isNotBlank(inviteStr)&&inviteStr.startsWith("m_")){
+            return Integer.valueOf(inviteStr.replace("m_",""));
+        }
+        return null;
+    }
 }

--
Gitblit v1.9.3