地图获取省份逻辑
This commit is contained in:
@@ -85,6 +85,15 @@ public class CrmSalesReportController extends BaseController {
|
||||
return R.ok(stats);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询省份统计数据
|
||||
*/
|
||||
@GetMapping("/provinceStats")
|
||||
public R<List<CrmSalesReportVo.ProvinceStat>> getProvinceStats(CrmSalesReportBo bo) {
|
||||
List<CrmSalesReportVo.ProvinceStat> stats = iCrmSalesReportService.queryProvinceStats(bo);
|
||||
return R.ok(stats);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出销售报表订单明细
|
||||
*/
|
||||
|
||||
@@ -290,4 +290,35 @@ public class CrmSalesReportVo {
|
||||
@ExcelProperty(value = "销售金额")
|
||||
private BigDecimal salesAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 省份统计内部类
|
||||
*/
|
||||
@Data
|
||||
public static class ProvinceStat {
|
||||
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
@ExcelProperty(value = "省份")
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 客户数量
|
||||
*/
|
||||
@ExcelProperty(value = "客户数量")
|
||||
private Integer customerCount;
|
||||
|
||||
/**
|
||||
* 订单数量
|
||||
*/
|
||||
@ExcelProperty(value = "订单数量")
|
||||
private Integer orderCount;
|
||||
|
||||
/**
|
||||
* 销售金额
|
||||
*/
|
||||
@ExcelProperty(value = "销售金额")
|
||||
private BigDecimal salesAmount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,4 +54,12 @@ public interface CrmSalesReportMapper {
|
||||
* @return 行业统计列表
|
||||
*/
|
||||
List<CrmSalesReportVo.IndustryStat> selectIndustryStats(@Param("bo") CrmSalesReportBo bo);
|
||||
|
||||
/**
|
||||
* 查询省份统计数据
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 省份统计列表
|
||||
*/
|
||||
List<CrmSalesReportVo.ProvinceStat> selectProvinceStats(@Param("bo") CrmSalesReportBo bo);
|
||||
}
|
||||
@@ -72,4 +72,12 @@ public interface ICrmSalesReportService {
|
||||
* @return 行业统计列表
|
||||
*/
|
||||
List<CrmSalesReportVo.IndustryStat> queryIndustryStats(CrmSalesReportBo bo);
|
||||
|
||||
/**
|
||||
* 查询省份统计数据
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 省份统计列表
|
||||
*/
|
||||
List<CrmSalesReportVo.ProvinceStat> queryProvinceStats(CrmSalesReportBo bo);
|
||||
}
|
||||
@@ -136,4 +136,12 @@ public class CrmSalesReportServiceImpl implements ICrmSalesReportService {
|
||||
public List<CrmSalesReportVo.IndustryStat> queryIndustryStats(CrmSalesReportBo bo) {
|
||||
return baseMapper.selectIndustryStats(bo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询省份统计数据
|
||||
*/
|
||||
@Override
|
||||
public List<CrmSalesReportVo.ProvinceStat> queryProvinceStats(CrmSalesReportBo bo) {
|
||||
return baseMapper.selectProvinceStats(bo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,4 +268,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
ORDER BY salesAmount DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询省份统计数据 -->
|
||||
<select id="selectProvinceStats" resultType="com.klp.crm.domain.vo.CrmSalesReportVo$ProvinceStat">
|
||||
SELECT
|
||||
COALESCE(c.province, '其他') as province,
|
||||
COUNT(DISTINCT c.customer_id) as customerCount,
|
||||
COUNT(o.order_id) as orderCount,
|
||||
COALESCE(SUM(o.order_amount), 0) as salesAmount
|
||||
FROM crm_order o
|
||||
LEFT JOIN crm_customer c ON o.customer_id = c.customer_id
|
||||
<include refid="selectCondition"/>
|
||||
GROUP BY c.province
|
||||
ORDER BY salesAmount DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
24
package-lock.json
generated
Normal file
24
package-lock.json
generated
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "klp-oa",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"three": "^0.184.0"
|
||||
}
|
||||
},
|
||||
"node_modules/three": {
|
||||
"version": "0.184.0",
|
||||
"resolved": "https://registry.npmmirror.com/three/-/three-0.184.0.tgz",
|
||||
"integrity": "sha512-wtTRjG92pM5eUg/KuUnHsqSAlPM296brTOcLgMRqEeylYTh/CdtvKUvCyyCQTzFuStieWxvZb8mVTMvdPyUpxg=="
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"three": {
|
||||
"version": "0.184.0",
|
||||
"resolved": "https://registry.npmmirror.com/three/-/three-0.184.0.tgz",
|
||||
"integrity": "sha512-wtTRjG92pM5eUg/KuUnHsqSAlPM296brTOcLgMRqEeylYTh/CdtvKUvCyyCQTzFuStieWxvZb8mVTMvdPyUpxg=="
|
||||
}
|
||||
}
|
||||
}
|
||||
5
package.json
Normal file
5
package.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"three": "^0.184.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user