From 9f56a3478708633de7e5f013901a4539b01b638c Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期二, 30 六月 2020 12:05:50 +0800
Subject: [PATCH] 订单结算时的红包
---
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOrderDetailFactory.java | 103 +++++++++++++++++++++++++++++++++++++--------------
1 files changed, 74 insertions(+), 29 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOrderDetailFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOrderDetailFactory.java
index 48b2cd3..7367531 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOrderDetailFactory.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOrderDetailFactory.java
@@ -14,18 +14,12 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TimeUtil;
+import com.yeshi.fanli.util.account.UserUtil;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
public class MsgOrderDetailFactory {
-
-
-
-
-
-
-
/**
* 鍒涘缓璁㈠崟琚粺璁℃秷鎭�
@@ -47,41 +41,47 @@
return null;
String fanliName = "";
- MsgTypeOrderTypeEnum typeEnum = null;
+ MsgTypeOrderTypeEnum orderTypeEnum = null;
String sourceName = Constant.getSourceName(source);
if (Constant.TYPE_REBATE == type) {
- fanliName = "杩斿埄锛�";
+ fanliName = "棰勪及杩斿埄:";
sourceName += "-杩斿埄璁㈠崟";
- typeEnum = MsgTypeOrderTypeEnum.fanli;
+ orderTypeEnum = MsgTypeOrderTypeEnum.orderStatistics;
} else if (Constant.TYPE_SHAER == type) {
- fanliName = "濂栭噾锛�";
+ fanliName = "棰勪及濂栭噾:";
sourceName += "-鍒嗕韩璁㈠崟";
- typeEnum = MsgTypeOrderTypeEnum.share;
+ orderTypeEnum = MsgTypeOrderTypeEnum.orderShare;
} else if (Constant.TYPE_INVITE == type) {
- fanliName = "鏀剁泭锛�";
+ fanliName = "棰勪及鏀剁泭:";
sourceName += "-鍥㈤槦璁㈠崟";
- typeEnum = MsgTypeOrderTypeEnum.invite;
+ orderTypeEnum = MsgTypeOrderTypeEnum.orderInvite;
}
// 娣诲姞鍐呭
List<CommonMsgItemVO> listMsg = new ArrayList<>();
listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟璇︽儏", ClientTextStyleVO.COLOR_TITLE),
new ClientTextStyleVO(sourceName, ClientTextStyleVO.COLOR_CONTENT)));
- // 璁㈠崟鍙峰彲鐐瑰嚮
- listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鍙�", ClientTextStyleVO.COLOR_TITLE),
- new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true));
+
+ if (Constant.TYPE_INVITE == type) {
+ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鍙�", ClientTextStyleVO.COLOR_TITLE),
+ new ClientTextStyleVO(UserUtil.filterOrderId(orderId), ClientTextStyleVO.COLOR_CONTENT), true));
+ } else {
+ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鍙�", ClientTextStyleVO.COLOR_TITLE),
+ new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true));
+ }
+ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("涓嬪崟鏃堕棿", ClientTextStyleVO.COLOR_TITLE),
+ new ClientTextStyleVO(TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT)));
+
List<ClientTextStyleVO> contentList = new ArrayList<>();
- contentList
- .add(new ClientTextStyleVO("涓嬪崟鏃堕棿锛�" + TimeUtil.formatDate(downTime), ClientTextStyleVO.COLOR_CONTENT));
- contentList.add(new ClientTextStyleVO("-鍟嗗搧鏁伴噺锛氬叡", ClientTextStyleVO.COLOR_CONTENT));
+ contentList.add(new ClientTextStyleVO("鍏�", ClientTextStyleVO.COLOR_CONTENT));
contentList.add(new ClientTextStyleVO(goodsCount + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
contentList.add(new ClientTextStyleVO("浠跺晢鍝�", ClientTextStyleVO.COLOR_CONTENT));
- listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鐩稿叧", ClientTextStyleVO.COLOR_TITLE),
+ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍟嗗搧鏁伴噺", ClientTextStyleVO.COLOR_TITLE),
contentList));
List<ClientTextStyleVO> contentList2 = new ArrayList<>();
- contentList2.add(new ClientTextStyleVO("瀹炰粯娆撅細", ClientTextStyleVO.COLOR_CONTENT));
+ contentList2.add(new ClientTextStyleVO("瀹炰粯娆�:", ClientTextStyleVO.COLOR_CONTENT));
contentList2.add(new ClientTextStyleVO("楼" + filterMoney(payMoney), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
contentList2.add(new ClientTextStyleVO("&" + fanliName, ClientTextStyleVO.COLOR_CONTENT));
contentList2.add(new ClientTextStyleVO("楼" + filterMoney(money), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
@@ -101,7 +101,7 @@
detail.setOrderType(source);
detail.setPayMoney(payMoney);
detail.setRead(false);
- detail.setType(typeEnum);
+ detail.setType(orderTypeEnum);
detail.setUser(new UserInfo(uid));
detail.setExtraInfo(new Gson().toJson(listMsg));
return detail;
@@ -136,10 +136,10 @@
String fanliName = "";
String sourceName = Constant.getSourceName(source);
if (Constant.TYPE_REBATE == type) {
- fanliName = "杩斿埄锛�";
+ fanliName = "棰勪及杩斿埄:";
sourceName += "-杩斿埄璁㈠崟";
} else if (Constant.TYPE_SHAER == type) {
- fanliName = "濂栭噾锛�";
+ fanliName = "棰勪及濂栭噾:";
sourceName += "-鍒嗕韩璁㈠崟";
}
@@ -154,15 +154,17 @@
listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鍙�", ClientTextStyleVO.COLOR_TITLE),
new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT), true));
+ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鎻愪氦鏃堕棿", ClientTextStyleVO.COLOR_TITLE),
+ new ClientTextStyleVO(TimeUtil.formatDate(submitTime), ClientTextStyleVO.COLOR_CONTENT)));
+
List<ClientTextStyleVO> contentList = new ArrayList<>();
- contentList.add(new ClientTextStyleVO("鎻愪氦鏃堕棿锛�" + TimeUtil.formatDate(submitTime), ClientTextStyleVO.COLOR_CONTENT));
- contentList.add(new ClientTextStyleVO("-鍟嗗搧鏁伴噺锛氬叡", ClientTextStyleVO.COLOR_CONTENT));
+ contentList.add(new ClientTextStyleVO("鍏�", ClientTextStyleVO.COLOR_CONTENT));
contentList.add(new ClientTextStyleVO(goodsCount + "", ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
contentList.add(new ClientTextStyleVO("浠跺晢鍝�", ClientTextStyleVO.COLOR_CONTENT));
- listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鐩稿叧", ClientTextStyleVO.COLOR_TITLE),contentList));
+ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍟嗗搧鏁伴噺", ClientTextStyleVO.COLOR_TITLE),contentList));
List<ClientTextStyleVO> contentList2 = new ArrayList<>();
- contentList2.add(new ClientTextStyleVO("瀹炰粯娆撅細", ClientTextStyleVO.COLOR_CONTENT));
+ contentList2.add(new ClientTextStyleVO("瀹炰粯娆�:", ClientTextStyleVO.COLOR_CONTENT));
contentList2.add(new ClientTextStyleVO("楼" + filterMoney(payMoney), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
contentList2.add(new ClientTextStyleVO("&" + fanliName, ClientTextStyleVO.COLOR_CONTENT));
contentList2.add(new ClientTextStyleVO("楼" + filterMoney(money), ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
@@ -173,6 +175,7 @@
MsgOrderDetail detail = new MsgOrderDetail();
+ detail.setOrderId(orderId);
detail.setBeiZhu(beiZhu);
detail.setCreateTime(new Date());
detail.setOrderType(source);
@@ -218,4 +221,46 @@
return detail;
}
+
+ /**
+ * 鍟嗗璺戣矾
+ * @param uid
+ * @param orderId
+ * @param orderSource
+ * @param type
+ * @return
+ */
+ public static MsgOrderDetail orderInvalidToBusinessRunning(Long uid, String orderId, int orderSource, int type) {
+ if (uid == null || StringUtil.isNullOrEmpty(orderId))
+ return null;
+
+ String fanliName = "";
+ String sourceName = Constant.getSourceName(orderSource);
+ if (Constant.TYPE_REBATE == type) {
+ fanliName = "杩斿埄璁㈠崟";
+ } else {
+ fanliName = "鍒嗕韩璁㈠崟";
+ }
+
+ List<CommonMsgItemVO> listMsg = new ArrayList<>();
+ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鐘舵��", ClientTextStyleVO.COLOR_TITLE),
+ new ClientTextStyleVO("鍟嗗搴楅摵宸茶"+sourceName+"灏佺锛屽晢鍝佷剑閲戝凡琚喕缁擄紝鏃犳硶缁撶畻浣i噾锛岃鍗曞凡澶辨晥", ClientTextStyleVO.COLOR_CONTENT)));
+ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟璇︽儏", ClientTextStyleVO.COLOR_TITLE),
+ new ClientTextStyleVO(fanliName, ClientTextStyleVO.COLOR_CONTENT)));
+ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("璁㈠崟鍙�", ClientTextStyleVO.COLOR_TITLE),
+ new ClientTextStyleVO(orderId, ClientTextStyleVO.COLOR_CONTENT)));
+ listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE),
+ new ClientTextStyleVO("鏃�", ClientTextStyleVO.COLOR_CONTENT)));
+
+ MsgOrderDetail detail = new MsgOrderDetail();
+ detail.setOrderId(orderId);
+ detail.setOrderType(orderSource);
+ detail.setType(MsgTypeOrderTypeEnum.businessRunning);
+ detail.setUser(new UserInfo(uid));
+ detail.setRead(false);
+ detail.setCreateTime(new Date());
+ detail.setUniquekey(StringUtil.Md5(uid+"&"+ orderId + "&" +orderSource + "&" + MsgTypeOrderTypeEnum.businessRunning.name()));
+ detail.setExtraInfo(new Gson().toJson(listMsg));
+ return detail;
+ }
}
--
Gitblit v1.8.0