Browse Source

个人签单客户新增剩余签单时间

anderx 7 years ago
parent
commit
ea473fd211

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

@@ -243,5 +243,7 @@ public interface UserMapper {
 	void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId);
 
 	List<userDataListBo> userDataStatistics(@Param("depId")String depId);
+
+	userDataListBo userDataStatisticsCount(@Param("depId")String depId);
 	
 }

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

@@ -230,12 +230,12 @@
 	<select id="selectSignPersonalCustomerList" resultType="com.goafanti.customer.bo.CustomerListOut">
 			select 
 			t0.uid as uid,
-			t0.update_time as lastSignTime,
-			t1.last_follow_time as lastFollowTime,
+			date_format(t0.update_time,'%Y-%m-%d %H:%i:%S') as  lastSignTime,
+			date_format(t1.last_follow_time,'%Y-%m-%d %H:%i:%S') as lastFollowTime,
 			t2.society_tag as societyTag,
 			t2.identify_name as name,
 			t2.share_type as shareType,
-			t2.transfer_time as transferTime,
+			date_format(t2.transfer_time,'%Y-%m-%d %H:%i:%S') as transferTime,
 			dg1.name as province,
 			dg2.name as city, 
 			dg3.name as area,
@@ -1974,4 +1974,30 @@ inner join(
 	where a.department_id=	#{depId,jdbcType=VARCHAR}
 	</if>
 	</select>
+	<select id="userDataStatisticsCount" resultType="com.goafanti.report.bo.userDataListBo">
+	select sum(z.signUser) as signUser,sum(z.fullUser) as fullUser,sum(z.dayFullUser) as dayFullUser,
+		sum(z.dayNewUser) as dayNewUser,sum(z.countUser) as countUser,sum(z.signFullUser) as signFullUser  from (
+	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>				
+	)z
+	</select>
 </mapper>

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

@@ -1264,6 +1264,9 @@ public class CustomerServiceImpl  extends BaseMybatisDao<UserMapper> implements
 		cli.setAid(TokenManager.getAdminId());
 		Map<String,Object> params = disposeParams(cli);
 		Pagination<CustomerListOut> list = (Pagination<CustomerListOut>) findPage("selectSignPersonalCustomerList","selectSignPersonalCustomerCount",params,pageNo,pageSize);
+		List<CustomerListOut> tmpList = (List<CustomerListOut>)list.getList();
+		setCustomerList(tmpList);
+		list.setList(tmpList);
 		return list;
 	}
 

+ 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 = "/open/api/admin/report")
+@RequestMapping(value = "/api/admin/report")
 public class ReportApiController extends BaseApiController {
 	@Autowired
 	SalesReportServiceImpl reportService;
@@ -229,5 +229,15 @@ public class ReportApiController extends BaseApiController {
 		
 	}
 	
+	/**
+	 * 客户资料统计报表总计
+	 */
+	@RequestMapping(value="/userDataStatisticsCount" , method=RequestMethod.GET)
+	public Result userDataStatisticsCount(String depId){
+		Result res=new Result();
+		return res.data(reportService.userDataStatisticsCount(depId));
+		
+	}
+	
 
 }

+ 4 - 0
src/main/java/com/goafanti/report/service/SalesReportServiceImpl.java

@@ -392,6 +392,10 @@ public class SalesReportServiceImpl extends BaseMybatisDao<DailySalesReportMappe
 	public List<userDataListBo> userDataStatistics(String depId) {
 		return userMapper.userDataStatistics(depId);
 	}
+
+	public userDataListBo userDataStatisticsCount(String depId) {
+		return userMapper.userDataStatisticsCount(depId);
+	}
 	
 
 }