Parcourir la source

客户资料报表修改新增字段

anderx il y a 7 ans
Parent
commit
184119f075

+ 3 - 0
src/main/java/com/goafanti/common/dao/UserMapper.java

@@ -23,6 +23,7 @@ import com.goafanti.customer.bo.FollowBusinessBo;
 import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.report.bo.CountMarketingStatisticsBo;
 import com.goafanti.report.bo.marketingESBo;
+import com.goafanti.report.bo.userDataListBo;
 
 public interface UserMapper {
 	/**
@@ -240,5 +241,7 @@ public interface UserMapper {
 	int checkCustomerInformation(String uid);
 
 	void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId);
+
+	List<userDataListBo> userDataStatistics(@Param("depId")String depId);
 	
 }

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

@@ -1951,4 +1951,27 @@ inner join(
 			and a.credit_rating is not null and a.credit_rating !=''    
 			and a.id=#{uid,jdbcType=VARCHAR}
 	</select>
+	<select id="userDataStatistics" resultType="com.goafanti.report.bo.userDataListBo">
+	select a.name ,c.name as  depName,ifnull(d.count,0) as signUser,ifnull(e.count,0) as fullUser,
+	ifnull(f.count,0) as dayFullUser,ifnull(g.count,0) as dayNewUser,ifnull(h.count,0) as countUser,
+	ifnull(i.count,0) as signFullUser
+	from admin a inner join (select uid from user_role x 
+	inner join(select id from `role`  where role_name in ('营销员','营销经理','营销管理员')) y
+	on x.rid=y.id)b on a.id =b.uid left join department_management c  on a.department_id=c.id
+	left join (select x.aid,count(1)as count from (select aid,uid from user_lock_release 
+		where type=1 and status=0 group by aid,uid)x group by aid)d on a.id=d.aid
+	left join (select aid,count(1) as count from user where integrity=1 group by aid) e on a.id=e.aid
+	left join (select aid,count(1) as count 
+		from user where integrity=1 and to_days(update_time)=to_days(now()) group by aid) f on a.id=f.aid
+	left join (select aid,count(1) as count 
+		from user where type=1 and status=0 and share_type=0 and to_days(create_time)=to_days(now()) group by aid) g on a.id=g.aid
+	left join (select aid,count(1) as count 
+		from user where type=1 and status=0 and share_type=0  group by aid) h on a.id=h.aid
+	left join (select x.aid,count(1)as count from (select x1.aid,x1.uid from user_lock_release x1
+				left join user y on x1.uid=y.id where x1.type=1 
+				and x1.status=0 and y.integrity=1 group by aid,uid)x group by aid) i on a.id=h.aid
+	<if test="depId!=null and depId!=''">
+	where a.department_id=	#{depId,jdbcType=VARCHAR}
+	</if>
+	</select>
 </mapper>

+ 85 - 0
src/main/java/com/goafanti/report/bo/userDataListBo.java

@@ -0,0 +1,85 @@
+package com.goafanti.report.bo;
+
+public class userDataListBo {
+	/**名称*/
+	private String name;
+	/**部门*/
+	private String depName;
+	/**签单客户数*/
+	private String signUser;
+	/**资料完善数*/
+	private String fullUser;
+	/**今日完善数*/
+	private String dayFullUser;
+	/**新增客户数*/
+	private String dayNewUser;
+	/**私有客户数*/
+	private String countUser;
+	/**签单客户完善数*/
+	private String signFullUser;
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getDepName() {
+		return depName;
+	}
+
+	public void setDepName(String depName) {
+		this.depName = depName;
+	}
+
+	public String getSignUser() {
+		return signUser;
+	}
+
+	public void setSignUser(String signUser) {
+		this.signUser = signUser;
+	}
+
+	public String getFullUser() {
+		return fullUser;
+	}
+
+	public void setFullUser(String fullUser) {
+		this.fullUser = fullUser;
+	}
+
+	public String getDayFullUser() {
+		return dayFullUser;
+	}
+
+	public void setDayFullUser(String dayFullUser) {
+		this.dayFullUser = dayFullUser;
+	}
+
+	public String getDayNewUser() {
+		return dayNewUser;
+	}
+
+	public void setDayNewUser(String dayNewUser) {
+		this.dayNewUser = dayNewUser;
+	}
+
+	public String getCountUser() {
+		return countUser;
+	}
+
+	public void setCountUser(String countUser) {
+		this.countUser = countUser;
+	}
+
+	public String getSignFullUser() {
+		return signFullUser;
+	}
+
+	public void setSignFullUser(String signFullUser) {
+		this.signFullUser = signFullUser;
+	}
+	
+
+}

+ 11 - 1
src/main/java/com/goafanti/report/controller/ReportApiController.java

@@ -21,7 +21,7 @@ import com.goafanti.report.enums.TimeType;
 import com.goafanti.report.service.SalesReportServiceImpl;
 
 @RestController
-@RequestMapping(value = "/api/admin/report")
+@RequestMapping(value = "/open/api/admin/report")
 public class ReportApiController extends BaseApiController {
 	@Autowired
 	SalesReportServiceImpl reportService;
@@ -219,5 +219,15 @@ public class ReportApiController extends BaseApiController {
 		
 	}
 	
+	/**
+	 * 客户资料统计报表
+	 */
+	@RequestMapping(value="/userDataStatistics" , method=RequestMethod.GET)
+	public Result userDataStatistics(String depId){
+		Result res=new Result();
+		return res.data(reportService.userDataStatistics(depId));
+		
+	}
+	
 
 }

+ 7 - 1
src/main/java/com/goafanti/report/service/SalesReportServiceImpl.java

@@ -26,6 +26,8 @@ import com.goafanti.report.bo.ReportDate;
 import com.goafanti.report.bo.SalesValues;
 import com.goafanti.report.bo.SomeTimeMarketingBo;
 import com.goafanti.report.bo.marketingESBo;
+import com.goafanti.report.bo.technicalDepListBo;
+import com.goafanti.report.bo.userDataListBo;
 import com.goafanti.report.enums.OrderBy;
 import com.goafanti.report.enums.SalesReportOrderField;
 import com.goafanti.report.enums.TimeType;
@@ -366,7 +368,7 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
 			return null;
 	}
 
-	public Object technicalDepStatistics(String depId, Integer timeType, String startTime, String endTime,
+	public List<technicalDepListBo> technicalDepStatistics(String depId, Integer timeType, String startTime, String endTime,
 			String publishStatus, String taskStatus) {
 		ReportDate rd = new ReportDate(new Date());
 		if (TimeType.WEEKLY.getCode()==timeType) {
@@ -386,6 +388,10 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
 		}
 		return null;
 	}
+
+	public List<userDataListBo> userDataStatistics(String depId) {
+		return userMapper.userDataStatistics(depId);
+	}
 	
 
 }