Browse Source

客户统计新增一般客户,意向客户,重点客户统计

anderx 1 year ago
parent
commit
8ad1d22bb2

+ 30 - 0
src/main/java/com/goafanti/admin/bo/AdminCustomerBo.java

@@ -24,6 +24,36 @@ public class AdminCustomerBo {
 	private Integer receiveCount;
 	/** 私有转交数 */
 	private Integer transferCount;
+	/** 一般客戶 */
+	private Integer generalCount;
+	/** 私有客戶 */
+	private Integer intentionCount;
+	/** 重点客户 */
+	private Integer keynoteCount;
+
+	public Integer getGeneralCount() {
+		return generalCount;
+	}
+
+	public void setGeneralCount(Integer generalCount) {
+		this.generalCount = generalCount;
+	}
+
+	public Integer getIntentionCount() {
+		return intentionCount;
+	}
+
+	public void setIntentionCount(Integer intentionCount) {
+		this.intentionCount = intentionCount;
+	}
+
+	public Integer getKeynoteCount() {
+		return keynoteCount;
+	}
+
+	public void setKeynoteCount(Integer keynoteCount) {
+		this.keynoteCount = keynoteCount;
+	}
 
 	public Integer getTransferCount() {
 		return transferCount;

+ 30 - 0
src/main/java/com/goafanti/admin/bo/DepCountBo.java

@@ -16,9 +16,39 @@ public class DepCountBo {
 	private Integer transferCount;
 	private Integer channelNewCount;
 	private Integer channelCompleteCount;
+	/** 一般客戶 */
+	private Integer generalCount;
+	/** 私有客戶 */
+	private Integer intentionCount;
+	/** 重点客户 */
+	private Integer keynoteCount;
 	private List<DepCountBo> list;
 	private List<AdminCustomerBo> aList;
 
+	public Integer getGeneralCount() {
+		return generalCount;
+	}
+
+	public void setGeneralCount(Integer generalCount) {
+		this.generalCount = generalCount;
+	}
+
+	public Integer getIntentionCount() {
+		return intentionCount;
+	}
+
+	public void setIntentionCount(Integer intentionCount) {
+		this.intentionCount = intentionCount;
+	}
+
+	public Integer getKeynoteCount() {
+		return keynoteCount;
+	}
+
+	public void setKeynoteCount(Integer keynoteCount) {
+		this.keynoteCount = keynoteCount;
+	}
+
 	public Integer getTransferCount() {
 		return transferCount;
 	}

+ 17 - 1
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -445,6 +445,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 						admin.setChannelNewCount(user.getChannelNewCount());
 						admin.setReceiveCount(user.getReceiveCount());
 						admin.setTransferCount(user.getTransferCount());
+						admin.setIntentionCount(user.getIntentionCount());
+						admin.setKeynoteCount(user.getKeynoteCount());
+						admin.setGeneralCount(user.getGeneralCount());
 						break;
 					}
 				}
@@ -471,6 +474,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		if (admin.getCompleteCount()==null) admin.setCompleteCount(0);
 		if (admin.getChannelCompleteCount()==null) admin.setChannelCompleteCount(0);
 		if (admin.getTransferCount()==null)admin.setTransferCount(0);
+		if (admin.getIntentionCount()==null)admin.setIntentionCount(0);
+		if (admin.getKeynoteCount()==null)admin.setKeynoteCount(0);
+		if (admin.getGeneralCount()==null)admin.setGeneralCount(0);
 	}
 
 	//迭代获取所有部门与部门员工并计算出部门数量
@@ -493,7 +499,8 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 	 * @param ab
 	 */
 	public void sumCount(DepCountBo ab) {
-		int completeCount=0,receiveCount=0,userCount=0,signCount=0,channelCount=0,newCount=0,channelNewCount=0,channelCompleteCount=0,transferCount=0;
+		int completeCount=0,receiveCount=0,userCount=0,signCount=0,channelCount=0,newCount=0,channelNewCount=0,
+				channelCompleteCount=0,transferCount=0,intentionCount=0,keynoteCount=0,generalCount=0;
 		if (ab.getList()!=null&&!ab.getList().isEmpty()) {
 			for (DepCountBo a : ab.getList()) {
 				if (a.getCompleteCount()!=null&& a.getCompleteCount()!=0) completeCount+=a.getCompleteCount();
@@ -505,6 +512,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 				if (a.getChannelNewCount()!=null&& a.getChannelNewCount()!=0) channelNewCount+=a.getChannelNewCount();
 				if (a.getChannelCompleteCount()!=null&& a.getChannelCompleteCount()!=0) channelCompleteCount+=a.getChannelCompleteCount();
 				if (a.getTransferCount()!=null&& a.getTransferCount()!=0)transferCount+=a.getTransferCount();
+				if (a.getIntentionCount()!=null&& a.getIntentionCount()!=0) intentionCount+=a.getIntentionCount();
+				if (a.getKeynoteCount()!=null&& a.getKeynoteCount()!=0) keynoteCount+=a.getKeynoteCount();
+				if (a.getGeneralCount()!=null&& a.getGeneralCount()!=0) generalCount=a.getGeneralCount();
 			}
 		}
 		if (ab.getaList()!=null&&!ab.getaList().isEmpty()) {
@@ -518,6 +528,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 				if (a.getChannelNewCount()!=null&& a.getChannelNewCount()!=0) channelNewCount+=a.getChannelNewCount();
 				if (a.getChannelCompleteCount()!=null&& a.getChannelCompleteCount()!=0) channelCompleteCount+=a.getChannelCompleteCount();
 				if (a.getTransferCount()!=null&& a.getTransferCount()!=0)transferCount+=a.getTransferCount();
+				if (a.getIntentionCount()!=null&& a.getIntentionCount()!=0) intentionCount+=a.getIntentionCount();
+				if (a.getKeynoteCount()!=null&& a.getKeynoteCount()!=0) keynoteCount+=a.getKeynoteCount();
+				if (a.getGeneralCount()!=null&& a.getGeneralCount()!=0) generalCount=a.getGeneralCount();
 			}
 		}
 		ab.setCompleteCount(completeCount);
@@ -529,6 +542,9 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 		ab.setChannelNewCount(channelNewCount);
 		ab.setChannelCompleteCount(channelCompleteCount);
 		ab.setTransferCount(transferCount);
+		ab.setIntentionCount(intentionCount);
+		ab.setKeynoteCount(keynoteCount);
+		ab.setGeneralCount(generalCount);
 
 	}
 

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

@@ -2328,7 +2328,10 @@ inner join(
 		sum(if(share_type=0 and source =1 and channel=0,1,0))newCount,
 		sum(if(share_type=0 and source =3 and channel=0,1,0))transferCount,
 		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 from `user` where `type` =1 and new_channel=0
+		sum(if(share_type=0 and source =2 and channel=0,1,0))receiveCount,
+		sum(if(share_type=0 and `level` =0,1,0))generalCount,
+		sum(if(share_type=0 and `level` =1,1,0))intentionCount,
+		sum(if(share_type=0 and `level` =2,1,0))keynoteCount from `user` where `type` =1 and new_channel=0
 		<if test="startTime != null and endTime != null">
 			and  transfer_time  between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
 		</if>