yangdamao 2 jaren geleden
bovenliggende
commit
8713ba2ca0

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java

@@ -3401,7 +3401,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             TopOrderStatisticsBo topOrderStatisticsBo = new TopOrderStatisticsBo();
             topOrderStatisticsBo.setStartTime(startTime - time);
             topOrderStatisticsBo.setEndTime(startTime);
-            topOrderStatisticsBo.setTenantId(item.getTenantId().toString());
+            topOrderStatisticsBo.setTenantId(bo.getTenantId());
+            topOrderStatisticsBo.setCustomerId(bo.getCustomerId());
             topOrderStatisticsBo.setBusinessName(bo.getBusinessName());
             topOrderStatisticsBo.setCreateSysUserId(bo.getCreateSysUserId());
             BigDecimal money = baseMapper.getSingleTenantStatistics(topOrderStatisticsBo);

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -1039,6 +1039,7 @@
         where
               g.goods_status = 1
               and g.status = 1
+              and g.goods_type != 5
               and g.education_type_id = #{educationTypeId}
               and g.project_id = #{projectId}
               and g.business_id = #{businessId}

+ 14 - 10
zhongzheng-system/src/main/resources/mapper/modules/top/TopOldOrderMapper.xml

@@ -1234,7 +1234,7 @@
                             AND tenant_id = #{tenantId}
                         </if>
                         <if test="customerId != null and customerId != ''">
-                            AND tenant_id  = #{customerId}
+                            AND old_customer_id = #{customerId}
                         </if>
                         GROUP BY
                             tenant_id
@@ -1348,8 +1348,12 @@
         AND vo.`status` = 1
         AND vo.check_status = 1
         AND vo.old_customer_id IS NOT NULL
-        AND vo.check_time BETWEEN #{startTime}
-        AND #{endTime}
+        <if test="startTime != null and startTime != ''">
+            AND vo.check_time &gt;= #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND vo.check_time &lt;= #{endTime}
+        </if>
         <if test="tenantId != null and tenantId != ''">
             AND vo.tenant_id = #{tenantId}
         </if>
@@ -1357,7 +1361,7 @@
             AND vo.create_sys_user_id = #{createSysUserId}
         </if>
         <if test="customerId != null and customerId != ''">
-            AND vo.tenant_id  = #{customerId}
+            AND vo.old_customer_id  = #{customerId}
         </if>
         <if test="businessName != null and businessName != ''">
             AND (
@@ -1416,7 +1420,7 @@
             AND tenant_id = #{tenantId}
         </if>
         <if test="customerId != null and customerId != ''">
-            AND tenant_id  = #{customerId}
+            AND old_customer_id  = #{customerId}
         </if>
         GROUP BY
         tenant_id
@@ -1535,7 +1539,7 @@
             AND tenant_id = #{tenantId}
         </if>
         <if test="customerId != null and customerId != ''">
-            AND tenant_id  = #{customerId}
+            AND old_customer_id  = #{customerId}
         </if>
         <if test="createSysUserId != null and createSysUserId != ''">
             AND create_sys_user_id = #{createSysUserId}
@@ -1625,7 +1629,7 @@
             AND too.tenant_id = #{tenantId}
         </if>
         <if test="customerId != null and customerId != ''">
-            AND too.tenant_id  = #{customerId}
+            AND too.old_customer_id  = #{customerId}
         </if>
         <if test="businessName != null and businessName != ''">
             AND (
@@ -1782,7 +1786,7 @@
                     AND ouu.business_name = #{businessName}
                 </if>
                 <if test="customerId != null and customerId != ''">
-                    AND oo.tenant_id  = #{customerId}
+                    AND oo.old_customer_id  = #{customerId}
                 </if>
                 GROUP BY
                     ouu.business_name UNION ALL
@@ -1883,7 +1887,7 @@
                 AND oo.create_sys_user_id = #{createSysUserId}
             </if>
             <if test="customerId != null and customerId != ''">
-                AND oo.tenant_id  = #{customerId}
+                AND oo.old_customer_id  = #{customerId}
             </if>
             GROUP BY
                 ouu.business_name UNION ALL
@@ -2183,7 +2187,7 @@
         og.tenant_id,
         2 AS order_type,
         IFNULL( SUM( og.goods_received ), 0 ) money2,
-        COUNT( * ) order_num2
+        COUNT(DISTINCT o.order_sn) order_num2
         <if test="tenantId != null and tenantId != ''">
             ,'' AS create_sys_user_id, '' as create_username
         </if>