首页客户日历

This commit is contained in:
黄绍春 2025-06-13 11:30:13 +08:00
parent c782367e28
commit 1e5ea1976e
6 changed files with 71 additions and 0 deletions

View File

@ -12,4 +12,13 @@ public class CustomerVO extends Customer{
@ApiModelProperty("创建人名称")
private String createName;
@ApiModelProperty("日历,日期")
private String date;
@ApiModelProperty("已跟进客户数量")
private String followedCount;
@ApiModelProperty("待跟进客户数量")
private String pendingCount;
}

View File

@ -85,4 +85,8 @@ public interface CustomerMapper
* @return
*/
List<LocalDateIntegerVO> selectDailyCreateCount(@Param("query") CustomerQuery query);
List<CustomerVO> selectCalendarCustomerNumber(@Param("query") CustomerQuery query);
}

View File

@ -260,4 +260,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by `key`
</select>
<select id="selectCalendarCustomerNumber" parameterType="CustomerQuery">
SELECT
date,
SUM(is_followed) AS followed_count,
SUM(is_pending) AS pending_count
FROM (
-- 已跟进客户按跟进日期统计
SELECT
DATE(last_follow_time) AS date,
1 AS is_followed,
0 AS is_pending
FROM bst_customer
WHERE follow_id = #{query.followId}
AND last_follow_time IS NOT NULL
UNION ALL
-- 待跟进客户按计划跟进日期统计
SELECT
DATE(next_follow_time) AS date,
0 AS is_followed,
1 AS is_pending
FROM bst_customer
WHERE follow_id = #{query.followId}
AND next_follow_time IS NOT NULL
AND status &lt; 3
) AS combined_data
GROUP BY date
ORDER BY date;
</select>
</mapper>

View File

@ -95,4 +95,8 @@ public interface CustomerService
* @return
*/
List<LocalDateIntegerVO> selectDailyCreateCount(CustomerQuery query);
List<CustomerVO> selectCalendarCustomerNumber(CustomerQuery query);
}

View File

@ -165,4 +165,9 @@ public class CustomerServiceImpl implements CustomerService
public List<LocalDateIntegerVO> selectDailyCreateCount(CustomerQuery query) {
return customerMapper.selectDailyCreateCount(query);
}
@Override
public List<CustomerVO> selectCalendarCustomerNumber(CustomerQuery query) {
return customerMapper.selectCalendarCustomerNumber(query);
}
}

View File

@ -65,6 +65,18 @@ public class CustomerController extends BaseController
return getDataTable(list);
}
/**
* 获取日历数据
* 待跟进客户数量已跟进客户数量
*/
@PreAuthorize("@ss.hasPermi('bst:customer:list')")
@GetMapping("/listNumber")
public AjaxResult getCustomerNumber(CustomerQuery query)
{
List<CustomerVO> customerVOS = customerService.selectCalendarCustomerNumber(query);
return success(customerVOS);
}
/**
* 查询客户列表ByIds
*/
@ -142,4 +154,8 @@ public class CustomerController extends BaseController
return toAjax(customerService.logicDel(ids));
}
}