Explorar el Código

营销首页修改

anderx hace 11 meses
padre
commit
11358e1f0a

+ 11 - 1
src/main/java/com/goafanti/admin/service/impl/AdminStatisticsServiceImpl.java

@@ -35,6 +35,10 @@ public class AdminStatisticsServiceImpl implements AdminStatisticsService {
     private SalesTeamMapper salesTeamMapper;
     @Resource
     private AdminCallDayMapper adminCallDayMapper;
+    @Resource
+    private UserFollowMapper userFollowMapper;
+    @Resource
+    private NewOrderDunMapper newOrderDunMapper;
 
 
     @Override
@@ -51,8 +55,14 @@ public class AdminStatisticsServiceImpl implements AdminStatisticsService {
             adminStatisticsBo.setPrivateSum(ListCount.getPrivateSum());
             adminStatisticsBo.setSignSum(ListCount.getSignSum());
             adminStatisticsBo.setChannelSum(ListCount.getChannelSum());
-        }
+            //计算公出次数
+            Integer publicSum = publicReleaseMapper.selectCountByaidAndDate(aid, null, null);
+            adminStatisticsBo.setPublicReleaseSum(publicSum);
+            //计算跟进次数
+            Integer followSum = userFollowMapper.selectByaidAndDate(aid, null, null);
+            adminStatisticsBo.setFollowSum(followSum);
 
+        }
         if (adminStatisticsBo.getReceivables()==null) adminStatisticsBo.setReceivables(new BigDecimal(0));
         AdminStatisticsBo asb = adminMapper.adminStatisticsInfoByTime(aid, startTime, endTime);
         if (asb==null) {

+ 6 - 3
src/main/java/com/goafanti/common/dao/NewOrderDunMapper.java

@@ -3,13 +3,13 @@ package com.goafanti.common.dao;
 import com.goafanti.common.model.NewOrderDun;
 import com.goafanti.common.model.NewOrderDunExample;
 import com.goafanti.order.bo.OutNewOrderDunBo;
-
-import java.util.List;
-
 import com.goafanti.order.bo.OutSelectOrderDun;
 import com.goafanti.order.bo.OutSelectOrderDunAll;
 import org.apache.ibatis.annotations.Param;
 
+import java.math.BigDecimal;
+import java.util.List;
+
 public interface NewOrderDunMapper {
     /**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table new_order_dun
@@ -91,4 +91,7 @@ public interface NewOrderDunMapper {
 
 	List<OutSelectOrderDun> selectOrderDun(@Param("depId") String depId,@Param("aid") String aid,@Param("sort") Integer sort,@Param("province") Integer province,
 										   @Param("startDate") String startDate, @Param("endDate")  String endDate);
+
+
+	BigDecimal selectByAidAndDate(@Param("aid") String aid, @Param("startTime") String startTime, @Param("endTime") String endTime);
 }

+ 6 - 8
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -1095,23 +1095,21 @@
         where a.id= #{aid}
     </select>
     <select id="adminStatisticsInfo" resultType="com.goafanti.admin.bo.AdminStatisticsBo">
-        select *
-        from (select aid ,
-                     sum(public_release_count)publicReleaseSum ,sum(follow_count) followSum,sum(order_count) orderSum
-              from admin_user_count a where aid=#{aid} group by aid)x
+        select x.id aid,y.projectCheckSum,y.projectStopSum,z.rejectSum,t.receivables
+        from admin x
                  left join(select a.salesman_id aid , sum(if( b.project_status =29,1,0))projectStopSum ,
                                   sum(if(b.check_status=1,1,0))projectCheckSum from t_order_new a left join t_order_task b
-                                                                                                            on a.order_no =b.order_no where a.salesman_id =  #{aid})y on x.aid=y.aid
+                                                                                                            on a.order_no =b.order_no where a.salesman_id =  #{aid})y on x.id=y.aid
                  left join (  select salesman_id aid,  sum(1)orderSum, sum(if(delete_sign=2,1,0))changeSum
                               from t_order_new where delete_sign in (0,2,3) and process_status >0
-                                                 and salesman_id =  #{aid})g on x.aid=g.aid
+                                                 and salesman_id =  #{aid})g on x.id=g.aid
                  left join (  select salesman_id aid,  sum(if(order_status=3 or order_status=5,1,0))rejectSum
                               from t_order_new where delete_sign in (0,2,3)
-                                                 and salesman_id =  #{aid})z on x.aid=z.aid
+                                                 and salesman_id =  #{aid})z on x.id=z.aid
                  left join (  SELECT b.salesman_id aid ,sum(a.money)  receivables
                               from new_order_dun a left join t_order_new b on a.order_no =b.order_no
                               where a.status =1   and b.delete_sign in (0,2,3)
-                                and b.salesman_id = #{aid})t on x.aid=t.aid
+                                and b.salesman_id = #{aid})t on x.id=t.aid
     </select>
 
     <select id="adminStatisticsInfoByTime" resultType="com.goafanti.admin.bo.AdminStatisticsBo">

+ 9 - 0
src/main/java/com/goafanti/common/mapper/NewOrderDunMapper.xml

@@ -538,4 +538,13 @@
     <if test="sort==1"> z.money </if>
     desc
   </select>
+  <select id="selectByAidAndDate" resultType="java.math.BigDecimal">
+      SELECT sum(money)
+      from new_order_dun a left join t_order_new b on a.order_no =b.order_no
+      where b.delete_sign in (0,2,3) and b.salesman_id = #{aid} and a.status =1
+      <if test="startTime!=null and endTime!=null">
+        and a.start_time between #{startTime} and #{endTime}
+      </if>
+  </select>
+
 </mapper>

+ 4 - 1
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -1062,7 +1062,10 @@
         from (select aid
               from public_release a left join public_release_details b on a.id=b.prid
               where status =2 and aid= #{aid}
-                and a.release_start BETWEEN #{startTime} and #{endTime} )x
+                <if test="startTime !=null and endTime !=null">
+                and a.release_start BETWEEN #{startTime} and #{endTime}
+              </if>
+              )x
         group by aid
     </select>
     <select id="selectByaidAndDate" resultType="com.goafanti.admin.bo.OutFinanceCount">

+ 4 - 2
src/main/java/com/goafanti/common/mapper/UserFollowMapper.xml

@@ -295,7 +295,9 @@
         select count(*)followCount
         from (select aid
               from user_follow where aid= #{aid}
-                                 and create_time BETWEEN #{startTime} and #{endTime})a
-        group by aid
+        <if test="startTime !=null and endTime !=null">
+            and create_time BETWEEN #{startTime} and #{endTime}
+        </if>
+        )a group by aid
     </select>
 </mapper>