From f4e107e273e66c36e5f5c7b4a8a2f1b07b3c15ed Mon Sep 17 00:00:00 2001
From: admin <2780501319@qq.com>
Date: 星期三, 04 三月 2020 16:03:20 +0800
Subject: [PATCH] 拼多多转链修改
---
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/OrderController.java | 106 +++++++++++++++++++++++++---------------------------
1 files changed, 51 insertions(+), 55 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/OrderController.java b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/OrderController.java
index ae30bd9..8f9dacf 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/OrderController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/OrderController.java
@@ -19,6 +19,7 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.order.ESOrder;
+import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.exception.order.CommonOrderException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.config.ConfigService;
@@ -49,10 +50,10 @@
@Resource
private UserCustomSettingsService userCustomSettingsService;
-
+
@Resource
private HongBaoV2CountService hongBaoV2CountService;
-
+
@Resource
private CommonOrderService commonOrderService;
@@ -67,7 +68,7 @@
@Resource
private RedisManager redisManager;
-
+
@Resource
private ESOrderService esOrderService;
@@ -97,7 +98,7 @@
List<Integer> listSource = new ArrayList<>();
listSource.add(Constant.SOURCE_TYPE_JD);
listSource.add(Constant.SOURCE_TYPE_PDD);
-
+
// 楠岃瘉鏄惁鏄剧ず妯″潡
if (settings != null && settings.getNoBonusCount() != null) {
if (settings.getNoBonusCount() == 1) {
@@ -120,10 +121,7 @@
data.put("inviteMoney", inviteMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
out.print(JsonUtil.loadTrueResult(data));
}
-
-
-
/**
* 璁㈠崟鍒楄〃
*
@@ -146,28 +144,28 @@
* 鏃堕棿娈碉細1-鏈�杩戜笁澶� 2-鏈�杩戜竷澶� 3鏈�杩戝崐鏈� 4鏈湀 5杩戜笁鏈� 6杩戝崐骞�
* @param dateType
* 1-浠婃棩 2-鏄ㄥぉ 3-鏈湀 4-涓婁釜鏈� |
- * @param source
- * 椤甸潰鏉ユ簮锛歸elfareCore-绂忓埄涓績銆乥onus -濂栭噾缁熻锛堟垜鐨勭晫闈級
+ * @param source
+ * 椤甸潰鏉ユ簮锛歸elfareCore-绂忓埄涓績銆乥onus -濂栭噾缁熻锛堟垜鐨勭晫闈級
* @param out
*/
@RequestMapping(value = "getOrderList", method = RequestMethod.POST)
- public void getOrderList(AcceptData acceptData, Integer page, Long uid, Integer state, String type,
- Integer orderState, String orderNo, String startTime, String endTime, Integer slotTime,
- Integer dateType, Integer goodsType, String source, PrintWriter out) {
+ public void getOrderList(AcceptData acceptData, Integer page, Long uid, Integer state, String type,
+ Integer orderState, String orderNo, String startTime, String endTime, Integer slotTime, Integer dateType,
+ Integer goodsType, String source, PrintWriter out) {
if (uid == null) {
out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�"));
return;
}
-
+
if (page == null || page < 1)
page = 1;
-
+
// 鎼滅储鍐呭銆佽鍗曞彿
if (!StringUtil.isNullOrEmpty(orderNo)) {
searchOrder(orderNo, page, uid, out);
return;
}
-
+
// 杞崲鐘舵��
if (state != null) {
if (state == 0) {
@@ -188,13 +186,13 @@
Integer orderType = null;
if (StringUtil.isNullOrEmpty(type)) {
orderType = null;
- } else if (!"0".equalsIgnoreCase(type)){
- orderType = Integer.parseInt(type);
- }
+ } else if (!"0".equalsIgnoreCase(type)) {
+ orderType = Integer.parseInt(type);
+ }
if (goodsType != null && goodsType == 0)
goodsType = null;
-
+
// 绛涢�夋椂闂�
if (slotTime != null) {
try {
@@ -228,7 +226,7 @@
e.printStackTrace();
}
}
-
+
if (endTime != null && endTime.trim().length() > 0) {
endTime += " 23:59:59";
}
@@ -240,9 +238,7 @@
listSource.add(Constant.SOURCE_TYPE_JD);
listSource.add(Constant.SOURCE_TYPE_PDD);
}
-
-
-
+
try {
// 绛涢�夌粨鏋滈《閮ㄧ粺璁�
String validMoney = "0.00";
@@ -250,14 +246,14 @@
if (page == 1) {
BigDecimal predictMoney = hongBaoV2CountService.getRewardMoneyByToSearch(uid, dateType, orderType, 1,
orderNo, state, startTime, endTime, listSource);
- if (predictMoney != null)
+ if (predictMoney != null)
validMoney = predictMoney.setScale(2, BigDecimal.ROUND_DOWN).toString();
-
+
BigDecimal postSaleMoney = hongBaoV2CountService.getRewardMoneyByToSearch(uid, dateType, orderType, 2,
orderNo, state, startTime, endTime, listSource);
- if (postSaleMoney != null)
+ if (postSaleMoney != null)
invalidMoney = postSaleMoney.setScale(2, BigDecimal.ROUND_DOWN).toString();
-
+
if (orderType != null && dateType != null && dateType == 4) {
if (orderType == 1) {
dateType = 6; // 杩斿埄璁㈠崟鏈夋晥
@@ -266,26 +262,26 @@
}
}
}
-
- // 鏌ヨ鍒楄〃
- List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, orderType, orderState,
- orderNo, startTime, endTime, dateType, listSource);
- // 缁熻鎬绘暟
- long count = commonOrderService.countGroupOrderNoByUid(uid, state, orderType, orderState, orderNo, startTime,
- endTime, dateType, listSource);
- // 鍒ゆ柇鏄惁闇�瑕佹樉绀鸿鍗曟壘鍥炴彁绀� 8绉掑唴璇锋眰3娆¤Е鍙�
+ // 鏌ヨ鍒楄〃
+ List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, orderType,
+ orderState, orderNo, startTime, endTime, dateType, listSource);
+ // 缁熻鎬绘暟
+ long count = commonOrderService.countGroupOrderNoByUid(uid, state, orderType, orderState, orderNo,
+ startTime, endTime, dateType, listSource);
+
+ // 鍒ゆ柇鏄惁闇�瑕佹樉绀鸿鍗曟壘鍥炴彁绀� 8绉掑唴璇锋眰3娆¤Е鍙�
String orderFindUrl = null;
- if (state ==null && page == 1) {
- if (redisManager.frequencyLimit("orderlist-" + acceptData.getDevice(), 8, 4)||count==0L) {
- orderFindUrl = configService.get("order_find_notify_url");
+ if (state == null && page == 1) {
+ if (redisManager.frequencyLimit("orderlist-" + acceptData.getDevice(), 8, 4) || count == 0L) {
+ orderFindUrl = configService.get(ConfigKeyEnum.orderFindNotifyUrl.getKey());
}
}
-
+
JSONObject data = new JSONObject();
data.put("count", count);
data.put("list", JsonUtil.getApiCommonGson().toJson(list));
- data.put("helpUrl", configService.get("order_list_help"));
+ data.put("helpUrl", configService.get(ConfigKeyEnum.orderListHelp.getKey()));
data.put("validMoney", "楼 " + validMoney);
data.put("invalidMoney", "楼 " + invalidMoney);
data.put("findOrderHelpUrl", orderFindUrl);
@@ -293,13 +289,17 @@
} catch (CommonOrderException e) {
out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
} catch (Exception e) {
- out.print(JsonUtil.loadFalseResult(1, "鏌ヨ澶辫触"));
+ if (Constant.IS_TEST) {
+ e.printStackTrace(out);
+ } else
+ out.print(JsonUtil.loadFalseResult(1, "鏌ヨ澶辫触"));
LogHelper.errorDetailInfo(e);
}
}
-
+
/**
* 鎼滅储璁㈠崟
+ *
* @param key
* @param out
*/
@@ -311,16 +311,16 @@
listSource.add(Constant.SOURCE_TYPE_JD);
listSource.add(Constant.SOURCE_TYPE_PDD);
List<ESOrder> listES = esOrderService.query(key, uid.toString(), listSource);
-
+
if (listES.size() != 0) {
list = commonOrderService.searchOrderByUid(page, Constant.PAGE_SIZE, uid, listES);
count = commonOrderService.countSearchOrderByUid(uid, listES);
}
-
+
if (list == null) {
list = new ArrayList<>();
}
-
+
JSONObject data = new JSONObject();
data.put("count", count);
data.put("list", JsonUtil.getApiCommonGson().toJson(list));
@@ -332,14 +332,12 @@
}
}
-
/**
* 鐢ㄦ埛璁㈠崟缁熻
*
* @param acceptData
* @param uid
- * 鐢ㄦ埛id
- * type 绫诲瀷锛�0鍏ㄩ儴銆�1娣樺疂 2浜笢銆佹嫾澶氬
+ * 鐢ㄦ埛id type 绫诲瀷锛�0鍏ㄩ儴銆�1娣樺疂 2浜笢銆佹嫾澶氬
* @param out
*/
@RequestMapping(value = "getOrderCount", method = RequestMethod.POST)
@@ -348,7 +346,7 @@
out.print(JsonUtil.loadFalseResult(1, "璇锋眰鍙傛暟涓嶆纭�"));
return;
}
-
+
try {
UserInfo user = userInfoService.selectByPKey(uid);
if (user == null) {
@@ -364,12 +362,12 @@
}
JSONObject data = new JSONObject();
data.put("userInfo", userInfo);
-
+
List<Integer> listSource = new ArrayList<>();
if (type == null || type == 0) {
listSource.add(Constant.SOURCE_TYPE_JD);
listSource.add(Constant.SOURCE_TYPE_PDD);
-
+
OrderCountVO total = commonOrderService.getOrderCount(uid, null, listSource);
data.put("total", total.getSelf() + total.getShared() + total.getInvite());
data.put("self", total.getSelf());
@@ -382,7 +380,7 @@
data.put("invite", 0);
listSource.add(type);
}
-
+
// 浠婂ぉ
OrderCountVO today = commonOrderService.getOrderCount(uid, 1, listSource);
today.setTotal(today.getSelf() + today.getShared() + today.getInvite());
@@ -406,7 +404,5 @@
e.printStackTrace();
}
}
-
+
}
-
-
--
Gitblit v1.8.0