Przeglądaj źródła

科德系统公出统计BUG修复

anderx 4 lat temu
rodzic
commit
5fb7589245

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

@@ -838,22 +838,22 @@
     select a.id as aid,a.name as aName,d.name as depName,ifnull(b.userCount,0) as userCount,ifnull(c.timeCount,0) as inputCount,
     select a.id as aid,a.name as aName,d.name as depName,ifnull(b.userCount,0) as userCount,ifnull(c.timeCount,0) as inputCount,
     ifnull(d.timeCount,0) as receiveCount,ifnull(g.timeCount,0) as signCount from admin a
     ifnull(d.timeCount,0) as receiveCount,ifnull(g.timeCount,0) as signCount from admin a
     left join (select aid,count(aid) as userCount from user where aid is not null
     left join (select aid,count(aid) as userCount from user where aid is not null
-    and  share_type=0 and source !=0 and type=1
+    and  share_type=0 and source in(1,2,3) and type=1 and new_channel=0
     group by aid) b on a.id=b.aid
     group by aid) b on a.id=b.aid
     left join (select aid,count(aid) as timeCount from `user` where aid is not null
     left join (select aid,count(aid) as timeCount from `user` where aid is not null
-    and  share_type in (0,2) and source =1 and type=1
+    and  share_type in (0,2) and source =1 and type=1 and new_channel=0
     <if test="startTime != null and endTime != null">
     <if test="startTime != null and endTime != null">
       and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
       and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
     </if>
     </if>
     group by aid) c on a.id=c.aid
     group by aid) c on a.id=c.aid
     left join (select aid,count(aid) as timeCount from `user` where aid is not null
     left join (select aid,count(aid) as timeCount from `user` where aid is not null
-    and  share_type in (0,2) and source =2 and type=1
+    and  share_type in (0,2) and source =2 and type=1 and new_channel=0
     <if test="startTime != null and endTime != null">
     <if test="startTime != null and endTime != null">
       and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
       and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
     </if>
     </if>
     group by aid) d on a.id=d.aid
     group by aid) d on a.id=d.aid
     left join (select aid,count(aid) as timeCount from `user` where aid is not null
     left join (select aid,count(aid) as timeCount from `user` where aid is not null
-    and share_type =2 and type=1
+    and share_type =2 and type=1  and new_channel=0
     <if test="startTime != null and endTime != null">
     <if test="startTime != null and endTime != null">
       and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
       and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
     </if>
     </if>
@@ -897,7 +897,7 @@
       </if>
       </if>
       )e on a.id=e.uid
       )e on a.id=e.uid
     </if>
     </if>
-    where  a.type=1
+    where  a.type=1 and a.new_channel=0
     <if test="type != 5 and type !=6">
     <if test="type != 5 and type !=6">
       and a.aid=  #{aid,jdbcType=VARCHAR}
       and a.aid=  #{aid,jdbcType=VARCHAR}
     </if>
     </if>
@@ -948,7 +948,7 @@
       </if>
       </if>
       )e on a.id=e.uid
       )e on a.id=e.uid
     </if>
     </if>
-    where  a.type=1
+    where  a.type=1 and a.new_channel=0
     <if test="type != 5 and type !=6">
     <if test="type != 5 and type !=6">
       and a.aid=  #{aid,jdbcType=VARCHAR}
       and a.aid=  #{aid,jdbcType=VARCHAR}
     </if>
     </if>

+ 26 - 26
src/main/java/com/goafanti/common/mapper/OrganizationManagementMapper.xml

@@ -96,7 +96,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Thu Nov 30 11:09:29 CST 2017.
       This element was generated on Thu Nov 30 11:09:29 CST 2017.
     -->
     -->
-    id, create_id, create_time, update_time, deleted_sign, name, type, manager_id, dep_no, 
+    id, create_id, create_time, update_time, deleted_sign, name, type, manager_id, dep_no,
     super_id, remarks, status,abbreviation,finance_id
     super_id, remarks, status,abbreviation,finance_id
   </sql>
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.OrganizationManagementExample" resultMap="BaseResultMap">
   <select id="selectByExample" parameterType="com.goafanti.common.model.OrganizationManagementExample" resultMap="BaseResultMap">
@@ -124,7 +124,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Thu Nov 30 11:09:29 CST 2017.
       This element was generated on Thu Nov 30 11:09:29 CST 2017.
     -->
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     from department
     from department
     where id = #{id,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
@@ -155,13 +155,13 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Thu Nov 30 11:09:29 CST 2017.
       This element was generated on Thu Nov 30 11:09:29 CST 2017.
     -->
     -->
-    insert into department (id, create_id, create_time, 
-      update_time, deleted_sign, name, 
+    insert into department (id, create_id, create_time,
+      update_time, deleted_sign, name,
       type, manager_id, dep_no, working_hours_type,
       type, manager_id, dep_no, working_hours_type,
       super_id, remarks, status
       super_id, remarks, status
       )
       )
-    values (#{id,jdbcType=VARCHAR}, #{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{deletedSign,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
+    values (#{id,jdbcType=VARCHAR}, #{createId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
+      #{updateTime,jdbcType=TIMESTAMP}, #{deletedSign,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
       #{type,jdbcType=VARCHAR}, #{managerId,jdbcType=VARCHAR}, #{depNo,jdbcType=VARCHAR}, #{workingHoursType,jdbcType=INTEGER},
       #{type,jdbcType=VARCHAR}, #{managerId,jdbcType=VARCHAR}, #{depNo,jdbcType=VARCHAR}, #{workingHoursType,jdbcType=INTEGER},
       #{superId,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}
       #{superId,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}
       )
       )
@@ -420,10 +420,10 @@
 			dm.name as superName,
 			dm.name as superName,
 			wh.name as workingHoursName,
 			wh.name as workingHoursName,
 			x.name as managerName
 			x.name as managerName
-		from department om 
+		from department om
 		left join department dm on om.super_id = dm.id
 		left join department dm on om.super_id = dm.id
 		left join admin x on om.manager_id = x.id
 		left join admin x on om.manager_id = x.id
-		left join working_hours wh  on om.working_hours_type =wh.`type` 
+		left join working_hours wh  on om.working_hours_type =wh.`type`
 		where 	om.deleted_sign = 0
 		where 	om.deleted_sign = 0
 		<if test="name !=null">
 		<if test="name !=null">
 			AND om.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
 			AND om.name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
@@ -444,7 +444,7 @@
 	<select id="selectOrganizationCount" resultType="java.lang.Integer">
 	<select id="selectOrganizationCount" resultType="java.lang.Integer">
 		select
 		select
 			count(0)
 			count(0)
-		from department om 
+		from department om
 		left join department dm on om.super_id = dm.id
 		left join department dm on om.super_id = dm.id
 		left join admin x on om.manager_id = x.id
 		left join admin x on om.manager_id = x.id
 		where om.deleted_sign = 0
 		where om.deleted_sign = 0
@@ -469,7 +469,7 @@
 		status ='0'
 		status ='0'
 		order by CONVERT (name USING gbk)
 		order by CONVERT (name USING gbk)
 		<if test="sort ==1" >
 		<if test="sort ==1" >
-		limit 10	
+		limit 10
 		</if>
 		</if>
 	</select>
 	</select>
 	<insert id="insert1" parameterType="com.goafanti.organization.bo.OrganizationListOut">
 	<insert id="insert1" parameterType="com.goafanti.organization.bo.OrganizationListOut">
@@ -481,7 +481,7 @@
 		#{deletedSign,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},
 		#{deletedSign,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},
 		#{type,jdbcType=VARCHAR},#{managerId,jdbcType=VARCHAR},
 		#{type,jdbcType=VARCHAR},#{managerId,jdbcType=VARCHAR},
 		#{depNo,jdbcType=VARCHAR},#{superId,jdbcType=VARCHAR},
 		#{depNo,jdbcType=VARCHAR},#{superId,jdbcType=VARCHAR},
-		#{desc,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR})	
+		#{desc,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR})
 	</insert>
 	</insert>
 	<!-- 得到上级 -->
 	<!-- 得到上级 -->
 	<select id="selectDepNo" resultType="String">
 	<select id="selectDepNo" resultType="String">
@@ -491,7 +491,7 @@
 		where
 		where
 		id=#{superId,jdbcType=VARCHAR}
 		id=#{superId,jdbcType=VARCHAR}
 	</select>
 	</select>
-	
+
 	<select id="selectDepNoByName" resultType="String">
 	<select id="selectDepNoByName" resultType="String">
 		select
 		select
 		dep_no as depNo
 		dep_no as depNo
@@ -528,10 +528,10 @@
 	    where id = #{id,jdbcType=VARCHAR}
 	    where id = #{id,jdbcType=VARCHAR}
   	</delete>
   	</delete>
   	<select id="selectAdminNameById" parameterType="java.lang.String" resultType="java.lang.String">
   	<select id="selectAdminNameById" parameterType="java.lang.String" resultType="java.lang.String">
-  		select 
+  		select
   		name
   		name
   		from admin
   		from admin
-  		where 
+  		where
   		id=#{id,jdbcType=VARCHAR}
   		id=#{id,jdbcType=VARCHAR}
   	</select>
   	</select>
   	<select id="selectIdByDepNo" parameterType="java.lang.String" resultType="java.lang.String">
   	<select id="selectIdByDepNo" parameterType="java.lang.String" resultType="java.lang.String">
@@ -549,7 +549,7 @@
 		dep_no as depNo,
 		dep_no as depNo,
 		super_id as superId,
 		super_id as superId,
 		remarks,status
 		remarks,status
-  		from department 		
+  		from department
   		where
   		where
   		super_id=#{id,jdbcType=VARCHAR}
   		super_id=#{id,jdbcType=VARCHAR}
   		order by dep_no
   		order by dep_no
@@ -572,16 +572,16 @@
   	<select id="selectIdByName" parameterType="java.lang.String" resultType="java.lang.String">
   	<select id="selectIdByName" parameterType="java.lang.String" resultType="java.lang.String">
   		select
   		select
   		id
   		id
-  		from department 		
+  		from department
   		where
   		where
-  		name=#{name,jdbcType=VARCHAR} 		
+  		name=#{name,jdbcType=VARCHAR}
   	</select>
   	</select>
   	<select id="selectNameById" parameterType="java.lang.String" resultType="java.lang.String">
   	<select id="selectNameById" parameterType="java.lang.String" resultType="java.lang.String">
   		select
   		select
   		name
   		name
-  		from department 		
+  		from department
   		where
   		where
-  		id=#{id,jdbcType=VARCHAR} 		
+  		id=#{id,jdbcType=VARCHAR}
   	</select>
   	</select>
   	<select id="selectDepNoById" resultType="String">
   	<select id="selectDepNoById" resultType="String">
 		select
 		select
@@ -607,7 +607,7 @@
 	<select id="selectSubDeps"  parameterType="java.lang.String" resultMap="BaseResultMap">
 	<select id="selectSubDeps"  parameterType="java.lang.String" resultMap="BaseResultMap">
 		select id,name,dep_no from department where super_id in (#{superIds,jdbcType=VARCHAR})
 		select id,name,dep_no from department where super_id in (#{superIds,jdbcType=VARCHAR})
 	</select>
 	</select>
-	
+
 		<select id="selectBysuperId"  resultType="com.goafanti.admin.bo.depCountBo">
 		<select id="selectBysuperId"  resultType="com.goafanti.admin.bo.depCountBo">
 		select a.id ,a.name ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
 		select a.id ,a.name ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
 		from department a left join department b on a.super_id=b.id where b.id= #{id}
 		from department a left join department b on a.super_id=b.id where b.id= #{id}
@@ -617,7 +617,7 @@
         select a.id ,a.name ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
         select a.id ,a.name ,0 userCount,0 inputCount,0 receiveCount, 0 completeCount, 0 interviewCount
         from department a left join department b on a.super_id=b.id where b.name= #{name}
         from department a left join department b on a.super_id=b.id where b.name= #{name}
     </select>
     </select>
-	
+
 	<!-- 查询所有 -->
 	<!-- 查询所有 -->
 	<select id="selectAllDeps" resultMap="BaseResultMap">
 	<select id="selectAllDeps" resultMap="BaseResultMap">
 		select id,name,dep_no from department
 		select id,name,dep_no from department
@@ -625,9 +625,9 @@
 	<select id="getMaxAbbreviation"  parameterType="java.lang.String" resultType="java.lang.String">
 	<select id="getMaxAbbreviation"  parameterType="java.lang.String" resultType="java.lang.String">
 	select max(contract_no) as maxNo from t_order_new
 	select max(contract_no) as maxNo from t_order_new
 	where create_time > '2019-5-31'
 	where create_time > '2019-5-31'
-	and contract_no like  concat(#{abbreviation,jdbcType=VARCHAR},'%') 
+	and contract_no like  concat(#{abbreviation,jdbcType=VARCHAR},'%')
 	</select>
 	</select>
-	
+
 	<select id="getDepAll" resultType="com.goafanti.admin.bo.AdminCustomerBo">
 	<select id="getDepAll" resultType="com.goafanti.admin.bo.AdminCustomerBo">
         select a.id aid,a.name aName,d.id depId,d.name depName,ifnull(b.userCount,0)userCount,ifnull(b.channelCount,0)channelCount,
         select a.id aid,a.name aName,d.id depId,d.name depName,ifnull(b.userCount,0)userCount,ifnull(b.channelCount,0)channelCount,
         ifnull(b.signCount,0)signCount,ifnull(b.newCount,0)newCount,ifnull(b.channelNewCount,0)channelNewCount,ifnull( b.receiveCount,0)receiveCount,
         ifnull(b.signCount,0)signCount,ifnull(b.newCount,0)newCount,ifnull(b.channelNewCount,0)channelNewCount,ifnull( b.receiveCount,0)receiveCount,
@@ -640,7 +640,7 @@
         sum(if(share_type=0 and source =1  and channel=0,1,0))newCount,
         sum(if(share_type=0 and source =1  and channel=0,1,0))newCount,
         sum(if(share_type=0 and source =1  and channel=1,1,0))channelNewCount,
         sum(if(share_type=0 and source =1  and channel=1,1,0))channelNewCount,
         sum(if(share_type=0 and source =2  and channel=0,1,0))receiveCount
         sum(if(share_type=0 and source =2  and channel=0,1,0))receiveCount
-        from `user` where `type` =1
+        from `user` where `type` =1 and new_channel=0
         <if test="startTime != null and endTime != null">
         <if test="startTime != null and endTime != null">
         and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
         and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
         </if>
         </if>
@@ -654,11 +654,11 @@
         left join department d on a.department_id=d.id
         left join department d on a.department_id=d.id
         where  a.status='正常'  and a.type=1
         where  a.status='正常'  and a.type=1
         <if test="adminName !=null">
         <if test="adminName !=null">
-	and a.name  like concat('%',#{adminName},'%')  
+	and a.name  like concat('%',#{adminName},'%')
 	</if>
 	</if>
 	<if test="depId !=null">
 	<if test="depId !=null">
 	and d.id= #{depId}
 	and d.id= #{depId}
 	</if>
 	</if>
 	</select>
 	</select>
 
 
-</mapper>
+</mapper>

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

@@ -1546,7 +1546,7 @@
       left join admin a on u.aid=a.id left join department d on a.department_id =d.id
       left join admin a on u.aid=a.id left join department d on a.department_id =d.id
       left join district_glossory dg on oi.location_province =dg.id
       left join district_glossory dg on oi.location_province =dg.id
     </if>
     </if>
-    where  u.`type` =1 and u.status=0
+    where  u.`type` =1 and u.status=0 and u.new_channel=0
     <if test="shiroType==1">
     <if test="shiroType==1">
       and u.information_maintainer = #{aid}
       and u.information_maintainer = #{aid}
     </if>
     </if>
@@ -1588,7 +1588,7 @@
         left join admin a on u.aid=a.id left join department d on a.department_id =d.id
         left join admin a on u.aid=a.id left join department d on a.department_id =d.id
       </if>
       </if>
     </if>
     </if>
-    where  u.`type` =1 and u.status=0
+    where  u.`type` =1 and u.status=0 and u.new_channel=0
     <if test="shiroType==1">
     <if test="shiroType==1">
       and u.information_maintainer = #{aid}
       and u.information_maintainer = #{aid}
     </if>
     </if>

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

@@ -1591,7 +1591,7 @@
 			<if test="follow !=null and follow!=''">
 			<if test="follow !=null and follow!=''">
 			left join (select aid,uid,contact_type from user_follow where aid= #{aid,jdbcType=VARCHAR} and contact_type=0 GROUP by uid) e on a.id=e.uid and a.aid=e.aid
 			left join (select aid,uid,contact_type from user_follow where aid= #{aid,jdbcType=VARCHAR} and contact_type=0 GROUP by uid) e on a.id=e.uid and a.aid=e.aid
 			</if>
 			</if>
-			where  a.status=0  and a.`type` =1
+			where  a.status=0  and a.`type` =1 and a.new_channel=0
 			and a.information_maintainer = #{aid,jdbcType=VARCHAR}
 			and a.information_maintainer = #{aid,jdbcType=VARCHAR}
 			<if test="type !=null and type!=''">
 			<if test="type !=null and type!=''">
 			and a.`type`=#{type,jdbcType=VARCHAR}
 			and a.`type`=#{type,jdbcType=VARCHAR}
@@ -1644,7 +1644,7 @@
 			<if test="follow  !=null and follow!=''">
 			<if test="follow  !=null and follow!=''">
 			left join (select aid,uid,contact_type from user_follow where aid= #{aid,jdbcType=VARCHAR} and contact_type=0 GROUP by uid) e on a.id=e.uid and a.aid=e.aid
 			left join (select aid,uid,contact_type from user_follow where aid= #{aid,jdbcType=VARCHAR} and contact_type=0 GROUP by uid) e on a.id=e.uid and a.aid=e.aid
 			</if>
 			</if>
-			where  a.status=0 and a.`type` =1
+			where  a.status=0 and a.`type` =1 and a.new_channel=0
 			  and a.information_maintainer = #{aid,jdbcType=VARCHAR}
 			  and a.information_maintainer = #{aid,jdbcType=VARCHAR}
 			<if test="type !=null and type!=''">
 			<if test="type !=null and type!=''">
 			and a.`type`=#{type,jdbcType=VARCHAR}
 			and a.`type`=#{type,jdbcType=VARCHAR}

+ 9 - 0
src/main/java/com/goafanti/customer/bo/OutChannelListBo.java

@@ -4,6 +4,7 @@ public class OutChannelListBo {
 
 
     private String id;
     private String id;
     private String name;
     private String name;
+    private String aid;
     private String aName;
     private String aName;
     /** 省 **/
     /** 省 **/
     private String province;
     private String province;
@@ -28,6 +29,14 @@ public class OutChannelListBo {
     /*剩余天数*/
     /*剩余天数*/
     private String RemainingDays;
     private String RemainingDays;
 
 
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
     public String getRemainingDays() {
     public String getRemainingDays() {
         return RemainingDays;
         return RemainingDays;
     }
     }

+ 2 - 0
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -2413,9 +2413,11 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		if (null!= in.getProvince()) params.put("province", in.getProvince());
 		if (null!= in.getProvince()) params.put("province", in.getProvince());
 		if (null!= in.getArea()) params.put("area", in.getArea());
 		if (null!= in.getArea()) params.put("area", in.getArea());
 		if (null!= in.getCity()) params.put("city", in.getCity());
 		if (null!= in.getCity()) params.put("city", in.getCity());
+		if (null!= in.getAid()) params.put("aid", in.getAid());
 		if (null!= in.getType()) params.put("type", in.getType());
 		if (null!= in.getType()) params.put("type", in.getType());
 		if (null!= in.getShareType()) params.put("shareType", in.getShareType());
 		if (null!= in.getShareType()) params.put("shareType", in.getShareType());
 		if (null != in.getNewChannel())params.put("newChannel", in.getNewChannel());
 		if (null != in.getNewChannel())params.put("newChannel", in.getNewChannel());
+
 	}
 	}
 
 
 	@Override
 	@Override