From 2147d023563a7c9d05d97547c00d6b0162c0644c Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 09 十一月 2020 18:37:24 +0800
Subject: [PATCH] 刷单风险规则优化

---
 fanli/src/main/java/com/yeshi/fanli/controller/admin/OrderAdminController.java |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/OrderAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/OrderAdminController.java
index 3e3d79b..708b119 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/OrderAdminController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/OrderAdminController.java
@@ -12,6 +12,7 @@
 
 import com.yeshi.fanli.entity.accept.AdminAcceptData;
 import com.yeshi.fanli.util.OrderConstant;
+import net.sf.json.JSONArray;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.multipart.MultipartFile;
@@ -146,8 +147,10 @@
      */
     @RequestMapping(value = "getUserOrderList")
     public void getUserOrderList(AdminAcceptData acceptData, String callback, Integer pageIndex, Integer pageSize, Integer keyType, String key,
-                                 Integer state, Integer type, Integer orderState, String startTime, String endTime, Integer sourceType,
+                                 Integer state, String type, Integer orderState, String startTime, String endTime, Integer sourceType,
                                  Integer riskType, BigDecimal payment, PrintWriter out) {
+
+        List<Integer> typeList = null;
 
         if (pageIndex == null || pageIndex < 1) {
             pageIndex = 1;
@@ -160,8 +163,15 @@
             state = null;// 鎵�鏈夌姸鎬�
         }
 
-        if (type != null && type == 0) {
-            type = null; // 鎵�鏈夌被鍨嬭鍗�
+        if (!StringUtil.isNullOrEmpty(type)) {
+            JSONArray array = JSONArray.fromObject(type);
+            if (array.size() > 0) {
+                typeList = new ArrayList<>();
+                for (int i = 0; i < array.size(); i++) {
+                    if (!StringUtil.isNullOrEmpty(array.optString(i)))
+                        typeList.add(array.optInt(i));
+                }
+            }
         }
 
         if (endTime != null && endTime.trim().length() > 0) {
@@ -177,18 +187,18 @@
             if (riskType != null && !StringUtil.isNullOrEmpty(key) && keyType != null && keyType == 2) {
                 long uid = Long.parseLong(key);
                 // 鏌ヨ鍚屽簵閾哄晢鍝侊紝鍚屽晢鍝佽鍗曡秴杩囦竴瀹氭暟閲忕殑
-                List<Integer> typeList = new ArrayList<>();
-                typeList.add(HongBaoV2.TYPE_ZIGOU);
+                List<Integer> hongBaoTypeList = new ArrayList<>();
+                hongBaoTypeList.add(HongBaoV2.TYPE_ZIGOU);
 
                 if (riskType == 1) {
-                    listGoodsId = commonOrderCountService.getSameGoodsOrderByUidAndHongBaoType(typeList, uid,
+                    listGoodsId = commonOrderCountService.getSameGoodsOrderByUidAndHongBaoType(hongBaoTypeList, uid,
                             Integer.parseInt(configService.getValue(ConfigKeyEnum.adminMinSameGoodsOrderCount.getKey(), acceptData.getSystem())));
                     if (listGoodsId == null || listGoodsId.isEmpty()) {
                         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鍚屽晢鍝佽鍗�"));
                         return;
                     }
                 } else if (riskType == 2) {
-                    listShopId = commonOrderCountService.getSameShopOrderByUidAndHongBaoType(typeList, uid,
+                    listShopId = commonOrderCountService.getSameShopOrderByUidAndHongBaoType(hongBaoTypeList, uid,
                             Integer.parseInt(configService.getValue(ConfigKeyEnum.adminMinSameShopOrderCount.getKey(), acceptData.getSystem())));
                     if (listShopId == null || listShopId.isEmpty()) {
                         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鍚屽簵閾鸿鍗�"));
@@ -202,10 +212,10 @@
 
             // 鏌ヨ鍒楄〃
             List<CommonOrderVO> list = commonOrderService.listQuery((pageIndex - 1) * pageSize, pageSize, keyType, key,
-                    state, type, orderState, startTime, endTime, sourceType, listShopId, listGoodsId, minTime, money, payment, acceptData.getSystem());
+                    state, typeList, orderState, startTime, endTime, sourceType, listShopId, listGoodsId, minTime, money, payment, acceptData.getSystem());
 
             // 缁熻鎬绘暟
-            long count = commonOrderService.countQuery(keyType, key, state, type, orderState, startTime, endTime,
+            long count = commonOrderService.countQuery(keyType, key, state, typeList, orderState, startTime, endTime,
                     sourceType, listShopId, listGoodsId, minTime, money, payment, acceptData.getSystem());
 
             for (CommonOrderVO order : list) {

--
Gitblit v1.8.0