From 1af395ecb948a9d0af14aa72d7fc8025e849e6bc Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 22 一月 2026 19:20:32 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
server/dmmall_service/src/main/java/com/doumee/core/utils/Constants.java | 55 ++++++++++++++++++
server/dmmall_service/src/main/java/com/doumee/service/business/impl/NoticeServiceImpl.java | 2
server/dmmall_service/src/main/java/com/doumee/dao/business/model/Goodsorder.java | 8 ++
server/dmmall_service/src/main/java/com/doumee/service/business/impl/AftersaleServiceImpl.java | 1
server/dmmall_service/src/main/java/com/doumee/core/wx/SendWxMessage.java | 65 +++++++++++++++++++++
server/dmmall_web/src/main/java/com/doumee/api/web/MemberApi.java | 2
6 files changed, 132 insertions(+), 1 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 2915e6e..711f9bf 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
@@ -991,6 +991,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;
+ }
+
+
+ }
+
+
+
/**
* 鏍囩绫诲瀷
diff --git a/server/dmmall_service/src/main/java/com/doumee/core/wx/SendWxMessage.java b/server/dmmall_service/src/main/java/com/doumee/core/wx/SendWxMessage.java
index 0ad0c54..2f78583 100644
--- a/server/dmmall_service/src/main/java/com/doumee/core/wx/SendWxMessage.java
+++ b/server/dmmall_service/src/main/java/com/doumee/core/wx/SendWxMessage.java
@@ -1,11 +1,14 @@
package com.doumee.core.wx;
import com.alibaba.fastjson.JSONObject;
+import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.HttpsUtil;
import com.doumee.dao.business.model.Goodsorder;
+import com.doumee.dao.business.model.GoodsorderDetail;
import com.doumee.dao.business.model.Member;
import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
@@ -13,7 +16,9 @@
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
/**
* Created by IntelliJ IDEA.
@@ -33,6 +38,66 @@
private static String programUserUrl = "pages/balanceDetails/balanceDetails";
+ public static void createSendData(Constants.WxNotice wxNotice, Goodsorder goodsorder, List<GoodsorderDetail> gdetailList, Member member){
+ Map<String, TemplateData> m = new HashMap<>();
+ String jumpUrl = wxNotice.getJumpUrl();
+ if(Constants.equalsInteger(wxNotice.getType(),Constants.ZERO)){
+ //鍙戣揣閫氱煡
+ m.put("character_string1}",new TemplateData(goodsorder.getCode().toString()));//璁㈠崟缂栧彿
+ m.put("thing7}",new TemplateData(String.join(",", gdetailList.stream().map(i->i.getName()).collect(Collectors.toList()))));//鍟嗗搧鍚嶇О
+ m.put("thing10}",new TemplateData(goodsorder.getKdName()));//蹇�掑叕鍙�
+ m.put("character_string3}",new TemplateData(goodsorder.getKdCode()));//蹇�掑崟鍙�
+ jumpUrl = jumpUrl+"?id="+goodsorder.getId();
+ }else if(Constants.equalsInteger(wxNotice.getType(),Constants.ONE)){
+ //璁㈠崟鏍搁攢
+ m.put("character_string3}",new TemplateData(goodsorder.getCode().toString()));//璁㈠崟缂栧彿
+ m.put("time2}",new TemplateData(DateUtil.formatDate(goodsorder.getDoneDate(),"yyyy骞碝M鏈坉d HH:mm")));//鏍搁攢鏃堕棿
+ m.put("phrase1}",new TemplateData("宸叉牳閿�"));//鏍搁攢鐘舵��
+ jumpUrl = jumpUrl+"?id="+goodsorder.getId();
+ }else if(Constants.equalsInteger(wxNotice.getType(),Constants.TWO)){
+ //璁㈠崟閫�娆�
+ m.put("character_string1}",new TemplateData(goodsorder.getCode().toString()));//璁㈠崟缂栧彿
+ m.put("thing2}",new TemplateData(String.join(",", gdetailList.stream().map(i->i.getName()).collect(Collectors.toList()))));//鍟嗗搧鍚嶇О
+ m.put("date9}",new TemplateData(DateUtil.formatDate(goodsorder.getRefundTime(),"yyyy骞碝M鏈坉d HH:mm")));//閫�娆炬椂闂�
+ m.put("phrase1}",new TemplateData(goodsorder.getRefundMoney()+"鍏�"));//閫�娆鹃噾棰�
+ jumpUrl = jumpUrl+"?id="+goodsorder.getId();
+ }
+ SendWxMessage.sendWxMessage(wxNotice.getTempId(),m,member.getOpenId(),jumpUrl);
+ }
+
+
+ /**
+ * 鍙戦�佹秷鎭�
+ * @param tempId
+ * @param m
+ * @param openid
+ * @param jumpUrl
+ */
+ public static void sendWxMessage(String tempId,Map<String, TemplateData> m,String openid,String jumpUrl){
+ try{
+ String accessToken = WxMiniConfig.wxMaService.getAccessToken();
+ RestTemplate restTemplate = new RestTemplate();
+ //杩欓噷绠�鍗曡捣瑙佹垜浠瘡娆¢兘鑾峰彇鏈�鏂扮殑access_token锛堟椂闂村紑鍙戜腑锛屽簲璇ュ湪access_token蹇繃鏈熸椂鍐嶉噸鏂拌幏鍙栵級
+ String url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="+accessToken;
+ //鎷兼帴鎺ㄩ�佺殑妯$増
+ WxMsgVO wxMsgVo = new WxMsgVO();
+ //鐢ㄦ埛鐨刼penid锛堣鍙戦�佺粰閭d釜鐢ㄦ埛锛�
+ wxMsgVo.setTouser(openid);
+ wxMsgVo.setTemplate_id(tempId);
+ wxMsgVo.setPage(jumpUrl);
+ ResponseEntity<String> responseEntity =
+ restTemplate.postForEntity(url, wxMsgVo, String.class);
+ log.info("寰俊灏忕▼搴�->鍙戦�佽闃呮秷鎭細{}",JSONObject.toJSONString(responseEntity));
+ }catch (WxErrorException wxErrorException){
+
+ }
+
+ }
+
+
+
+
+
/**
* 鍙栨秷璁㈠崟 閫氱煡
* @param member 浼氬憳淇℃伅
diff --git a/server/dmmall_service/src/main/java/com/doumee/dao/business/model/Goodsorder.java b/server/dmmall_service/src/main/java/com/doumee/dao/business/model/Goodsorder.java
index 1874f39..c39dc11 100644
--- a/server/dmmall_service/src/main/java/com/doumee/dao/business/model/Goodsorder.java
+++ b/server/dmmall_service/src/main/java/com/doumee/dao/business/model/Goodsorder.java
@@ -209,6 +209,14 @@
@ApiModelProperty(value = "杩旇繕鐢ㄦ埛绉垎", example = "1")
private BigDecimal returnMemberIntegral;
+ @ApiModelProperty(value = "閫�娆鹃噾棰�", example = "1")
+ private BigDecimal refundMoney;
+
+ @ApiModelProperty(value = "閫�娆炬椂闂�", example = "1")
+ private Date refundTime;
+
+ @ApiModelProperty(value = "閫�娆炬搷浣滀汉", example = "1")
+ private Integer refundUserId;
@ApiModelProperty(value = "鏂囦欢鍦板潃")
@TableField(exist = false)
diff --git a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/AftersaleServiceImpl.java b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/AftersaleServiceImpl.java
index e5e986c..05105fe 100644
--- a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/AftersaleServiceImpl.java
+++ b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/AftersaleServiceImpl.java
@@ -224,6 +224,7 @@
}
Aftersale model = findJoinById(aftersale.getId(),false);
aftersale.setMemberId(model.getMemberId());
+ aftersale.setMemberId(model.getMemberId());
if(model ==null || Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝璇ュ敭鍚庤褰曚笉瀛樺湪锛岃杩斿洖鍒锋柊閲嶈瘯锛�");
}
diff --git a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/NoticeServiceImpl.java b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/NoticeServiceImpl.java
index f7b9193..3778d0d 100644
--- a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/NoticeServiceImpl.java
+++ b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/NoticeServiceImpl.java
@@ -216,7 +216,6 @@
@Override
public PageData<NoticeCardDTO> findNoticeCardDTOPage(PageWrap<Notice> pageWrap) {
-
LoginUserInfo loginUserInfo = (LoginUserInfo)SecurityUtils.getSubject().getPrincipal();
IPage<Notice> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
LambdaQueryWrapper<Notice> queryWrapper = new LambdaQueryWrapper<>();
@@ -242,4 +241,5 @@
pageData.setRecords(noticeCardDTOs);
return pageData;
}
+
}
diff --git a/server/dmmall_web/src/main/java/com/doumee/api/web/MemberApi.java b/server/dmmall_web/src/main/java/com/doumee/api/web/MemberApi.java
index a97ba88..424160a 100644
--- a/server/dmmall_web/src/main/java/com/doumee/api/web/MemberApi.java
+++ b/server/dmmall_web/src/main/java/com/doumee/api/web/MemberApi.java
@@ -66,6 +66,8 @@
memberService.updateMemberOwnDTO(memberOwnDTO);
return ApiResponse.success(null);
}
+
+
/**
* 鏌ヨ鍏虫敞鐨勪汉鍜屽晢閾�
* @param pageWrap
--
Gitblit v1.9.3