Explorar o código

机构画像调整

huangzhiguo %!s(int64=2) %!d(string=hai) anos
pai
achega
91b67f5abe

+ 6 - 6
src/main/java/com/caimei365/user/service/impl/ClubServiceImpl.java

@@ -2191,7 +2191,7 @@ public class ClubServiceImpl implements ClubService {
             if (cmPortrait.getEndTime().equals(endTime)) {
                 cmPortrait.setEndTime(dateFormat.format(date));
             }
-            int ordinary = 0, secondHand = 0, rebate = 0, partialRefund = 0, fullRefund = 0, closed = 0,total = 0;
+            int ordinary = 0, secondHand = 0, rebate = 0, partialRefund = 0,total = 0; //, fullRefund = 0, closed = 0
             double orderScopeTotalFee = 0.0;
             ArrayList<PortraitMap> orderPortraits = new ArrayList<>();
             PortraitMap orderPortrait = new PortraitMap();
@@ -2223,13 +2223,13 @@ public class ClubServiceImpl implements ClubService {
                         partialRefund++;
                     }
                     // 全部退款
-                    if ("2".equals(order.getRefundType()) && !"6".equals(order.getStatus())) {
+                    /*if ("2".equals(order.getRefundType()) && !"6".equals(order.getStatus())) {
                         fullRefund++;
                     }
                     // 已关闭
                     if ("6".equals(order.getStatus()) || StringUtils.isEmpty(order.getStatus())) {
                         closed++;
-                    }
+                    }*/
                     if (null != order.getPayTotalFee()) {
                         orderScopeTotalFee += order.getPayTotalFee();
                     }
@@ -2278,7 +2278,7 @@ public class ClubServiceImpl implements ClubService {
                     orderPortrait.setPer("0");
                 }
                 orderPortraits.add(orderPortrait);
-                orderPortrait = new PortraitMap();
+                /*orderPortrait = new PortraitMap();
                 orderPortrait.setValue(fullRefund);
                 if (fullRefund != 0) {
                     orderPortrait.setName("全部退款");
@@ -2297,13 +2297,13 @@ public class ClubServiceImpl implements ClubService {
                     orderPortrait.setName("已关闭");
                     orderPortrait.setPer("0");
                 }
-                orderPortraits.add(orderPortrait);
+                orderPortraits.add(orderPortrait);*/
                 cmPortrait.setOrderPortrait(orderPortraits);
             } else {
                 cmPortrait.setOrderTotalAmount(BigDecimal.ZERO);
             }
             // 总量
-            total = ordinary + secondHand + rebate + partialRefund + fullRefund + closed;
+            total = ordinary + secondHand + rebate + partialRefund; // + fullRefund + closed
             cmPortrait.setOrderScopeNum(total);
             calendar.setTime(date);
             calendar.add(Calendar.DAY_OF_MONTH, -1);

+ 7 - 14
src/main/resources/mapper/ClubMapper.xml

@@ -1023,17 +1023,10 @@
         WHERE csg.serviceId = #{spId}
     </select>
     <select id="selTotal" resultType="com.caimei365.user.model.dto.CmPortraitDto">
-        SELECT (SELECT COUNT(orderID) FROM cm_order WHERE clubID = #{clubId} AND orderTime <![CDATA[ < ]]> now())      AS orderTotal,
-               (SELECT SUM(payTotalFee)
-                FROM cm_order
-                WHERE clubID = #{clubId}
-                  AND orderTime <![CDATA[ < ]]> now())                                                                 AS orderTotalAmount,
-               (SELECT COUNT(cbr.recordID)
-                FROM cm_behavior_record cbr
-                         LEFT JOIN club c ON cbr.userID = c.userID
-                WHERE cbr.pageType IN (8, 9)
-                  AND c.clubID = #{clubId}
-                  AND cbr.accessDate <![CDATA[ < ]]> now())                                                            AS totalkeywords,
+        SELECT (SELECT COUNT(orderID) FROM cm_order WHERE clubID = #{clubId} AND STATUS != 6 AND STATUS != 7 AND refundType != 2 AND orderTime <![CDATA[ < ]]> now())      AS orderTotal,
+               (SELECT SUM(payTotalFee) FROM cm_order WHERE clubID = #{clubId} AND STATUS != 6 AND STATUS != 7 AND refundType != 2 AND orderTime <![CDATA[ < ]]> now())                                                                 AS orderTotalAmount,
+               (SELECT COUNT(cbr.recordID) FROM cm_behavior_record cbr LEFT JOIN club c ON cbr.userID = c.userID
+                WHERE cbr.pageType IN (8, 9) AND c.clubID = #{clubId} AND cbr.accessDate <![CDATA[ < ]]> now())                                                            AS totalkeywords,
                (SELECT COUNT(remarks) FROM cm_club_remarks WHERE clubID = #{clubId} AND addTime <![CDATA[ < ]]> now()) AS remarksTotal
     </select>
     <select id="accessRecords" resultType="com.caimei365.user.model.vo.RecordVo">
@@ -1064,8 +1057,8 @@
     </select>
     <select id="selOrderList" resultType="com.caimei365.user.model.po.NewOrderPo">
         SELECT
-        (SELECT COUNT(orderID) FROM cm_order WHERE clubID = #{clubId}) as numbers,
-        (SELECT SUM(payTotalFee) FROM cm_order WHERE clubID = #{clubId}) as totalMoney,
+        (SELECT COUNT(orderID) FROM cm_order WHERE clubID = #{clubId} AND STATUS != 6 AND STATUS != 7 AND refundType != 2) as numbers,
+        (SELECT SUM(payTotalFee) FROM cm_order WHERE clubID = #{clubId} AND STATUS != 6 AND STATUS != 7 AND refundType != 2) as totalMoney,
         clubID,
         secondHandOrderFlag,
         rebateFlag,
@@ -1075,7 +1068,7 @@
         orderTime
         FROM cm_order
         <where>
-            clubID = #{clubId}
+            clubID = #{clubId} AND STATUS != 6 AND STATUS != 7 AND refundType != 2
             <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
                 AND orderTime <![CDATA[ >= ]]> #{startTime} AND orderTime <![CDATA[ <= ]]> #{endTime}
             </if>