Merge remote-tracking branch 'yudao/develop' into develop
# Conflicts: # yudao-module-crm/yudao-module-crm-biz/src/main/java/cn/iocoder/yudao/module/crm/service/business/CrmBusinessServiceImpl.javaplp
commit
59dfa10461
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.framework.flowable.core.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程常量信息
|
||||||
|
*/
|
||||||
|
public interface BpmnModelConstants {
|
||||||
|
|
||||||
|
String BPMN_FILE_SUFFIX = ".bpmn";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BPMN 中的命名空间
|
||||||
|
*
|
||||||
|
* 这个东西有可能导致无法切换工作流程的实现
|
||||||
|
*/
|
||||||
|
String NAMESPACE = "http://flowable.org/bpmn";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义属性 dataType
|
||||||
|
*/
|
||||||
|
String PROCESS_CUSTOM_DATA_TYPE = "dataType";
|
||||||
|
|
||||||
|
}
|
||||||
@ -1 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bi.api;
|
|
||||||
@ -1 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bi.enums;
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
### 合同金额排行榜
|
|
||||||
GET {{baseUrl}}/bi/rank/contract-ranKing
|
|
||||||
Authorization: Bearer {{token}}
|
|
||||||
tenant-id: {{adminTenentId}}
|
|
||||||
|
|
||||||
### 回款金额排行榜
|
|
||||||
GET {{baseUrl}}/bi/rank/receivables-ranKing
|
|
||||||
Authorization: Bearer {{token}}
|
|
||||||
tenant-id: {{adminTenentId}}
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bi.dal.mysql;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|
||||||
import cn.iocoder.yudao.module.bi.controller.admin.ranking.vo.BiContractRanKingRespVO;
|
|
||||||
import cn.iocoder.yudao.module.bi.controller.admin.ranking.vo.BiReceivablesRanKingRespVO;
|
|
||||||
import cn.iocoder.yudao.module.bi.util.BiTimeUtil;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author anhaohao
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface BiRankingMapper extends BaseMapperX {
|
|
||||||
/**
|
|
||||||
* 合同金额排行榜
|
|
||||||
*
|
|
||||||
* @param biTimeEntity 参数
|
|
||||||
* @return List<BiContractAmountRankingRespVO>
|
|
||||||
*/
|
|
||||||
List<BiContractRanKingRespVO> contractRanKing(BiTimeUtil.BiTimeEntity biTimeEntity);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 回款金额排行榜
|
|
||||||
*
|
|
||||||
* @param biTimeEntity 参数
|
|
||||||
* @return List<BiContractAmountRankingRespVO>
|
|
||||||
*/
|
|
||||||
List<BiReceivablesRanKingRespVO> receivablesRanKing(BiTimeUtil.BiTimeEntity biTimeEntity);
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
/**
|
|
||||||
* 属于 bi 模块的 framework 封装
|
|
||||||
*
|
|
||||||
* @author 芋道源码
|
|
||||||
*/
|
|
||||||
package cn.iocoder.yudao.module.bi.framework;
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bi.framework.web.config;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration;
|
|
||||||
import org.springdoc.core.models.GroupedOpenApi;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* bi 模块的 web 组件的 Configuration
|
|
||||||
*
|
|
||||||
* @author 芋道源码
|
|
||||||
*/
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
|
||||||
public class BiWebConfiguration {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* bi 模块的 API 分组
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public GroupedOpenApi biGroupedOpenApi() {
|
|
||||||
return YudaoSwaggerAutoConfiguration.buildGroupedOpenApi("bi");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
/**
|
|
||||||
* bi 模块的 web 配置
|
|
||||||
*/
|
|
||||||
package cn.iocoder.yudao.module.bi.framework.web;
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bi.service.ranking;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.bi.controller.admin.ranking.vo.BiContractRanKingRespVO;
|
|
||||||
import cn.iocoder.yudao.module.bi.controller.admin.ranking.vo.BiParams;
|
|
||||||
import cn.iocoder.yudao.module.bi.controller.admin.ranking.vo.BiRankReqVO;
|
|
||||||
import cn.iocoder.yudao.module.bi.controller.admin.ranking.vo.BiReceivablesRanKingRespVO;
|
|
||||||
import cn.iocoder.yudao.module.bi.dal.mysql.BiRankingMapper;
|
|
||||||
import cn.iocoder.yudao.module.bi.util.BiTimeUtil;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author anhaohao
|
|
||||||
*/
|
|
||||||
@Service(value = "biRankService")
|
|
||||||
@Validated
|
|
||||||
public class BiRankingServiceImpl implements BiRankingService {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private BiRankingMapper biRankingMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BiContractRanKingRespVO> contractRanKing(BiRankReqVO biRankReqVO) {
|
|
||||||
BiParams biParams = new BiParams();
|
|
||||||
biParams.setType(biRankReqVO.getType());
|
|
||||||
biParams.setDeptId(biRankReqVO.getDeptId());
|
|
||||||
biParams.setIsUser(0);
|
|
||||||
BiTimeUtil.BiTimeEntity biTimeEntity = BiTimeUtil.analyzeType(biParams);
|
|
||||||
List<Long> userIds = biTimeEntity.getUserIds();
|
|
||||||
if (userIds.isEmpty()) {
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
return biRankingMapper.contractRanKing(biTimeEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BiReceivablesRanKingRespVO> receivablesRanKing(BiRankReqVO biRankReqVO) {
|
|
||||||
BiParams biParams = new BiParams();
|
|
||||||
biParams.setType(biRankReqVO.getType());
|
|
||||||
biParams.setDeptId(biRankReqVO.getDeptId());
|
|
||||||
biParams.setIsUser(0);
|
|
||||||
BiTimeUtil.BiTimeEntity biTimeEntity = BiTimeUtil.analyzeType(biParams);
|
|
||||||
List<Long> userIds = biTimeEntity.getUserIds();
|
|
||||||
if (userIds.isEmpty()) {
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
return biRankingMapper.receivablesRanKing(biTimeEntity);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
### 合同金额排行榜
|
||||||
|
GET {{baseUrl}}/crm/bi-rank/get-contract-price-rank?deptId=100×[0]=2022-12-12 00:00:00×[1]=2024-12-12 23:59:59
|
||||||
|
Authorization: Bearer {{token}}
|
||||||
|
tenant-id: {{adminTenentId}}
|
||||||
|
|
||||||
|
### 回款金额排行榜
|
||||||
|
GET {{baseUrl}}/crm/bi-rank/get-receivable-price-rank?deptId=100×[0]=2022-12-12 00:00:00×[1]=2024-12-12 23:59:59
|
||||||
|
Authorization: Bearer {{token}}
|
||||||
|
tenant-id: {{adminTenentId}}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.controller.admin.bi;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.bi.vo.CrmBiRanKRespVO;
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.bi.vo.CrmBiRankReqVO;
|
||||||
|
import cn.iocoder.yudao.module.crm.service.bi.CrmBiRankingService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - CRM BI 排行榜")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/crm/bi-rank")
|
||||||
|
@Validated
|
||||||
|
public class CrmBiRankController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CrmBiRankingService rankingService;
|
||||||
|
|
||||||
|
@GetMapping("/get-contract-price-rank")
|
||||||
|
@Operation(summary = "获得合同金额排行榜")
|
||||||
|
@PreAuthorize("@ss.hasPermission('crm:bi-rank:query')")
|
||||||
|
public CommonResult<List<CrmBiRanKRespVO>> getContractPriceRank(@Valid CrmBiRankReqVO rankingReqVO) {
|
||||||
|
return success(rankingService.getContractPriceRank(rankingReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get-receivable-price-rank")
|
||||||
|
@Operation(summary = "获得回款金额排行榜")
|
||||||
|
@PreAuthorize("@ss.hasPermission('crm:bi-rank:query')")
|
||||||
|
public CommonResult<List<CrmBiRanKRespVO>> getReceivablePriceRank(@Valid CrmBiRankReqVO rankingReqVO) {
|
||||||
|
return success(rankingService.getReceivablePriceRank(rankingReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.dal.mysql.bi;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.bi.vo.CrmBiRanKRespVO;
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.bi.vo.CrmBiRankReqVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CRM BI 排行榜 Mapper
|
||||||
|
*
|
||||||
|
* @author anhaohao
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CrmBiRankingMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询合同金额排行榜
|
||||||
|
*
|
||||||
|
* @param rankReqVO 参数
|
||||||
|
* @return 合同金额排行榜
|
||||||
|
*/
|
||||||
|
List<CrmBiRanKRespVO> selectContractPriceRank(CrmBiRankReqVO rankReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询回款金额排行榜
|
||||||
|
*
|
||||||
|
* @param rankReqVO 参数
|
||||||
|
* @return 回款金额排行榜
|
||||||
|
*/
|
||||||
|
List<CrmBiRanKRespVO> selectReceivablePriceRank(CrmBiRankReqVO rankReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package cn.iocoder.yudao.module.crm.service.bi;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.bi.vo.CrmBiRanKRespVO;
|
||||||
|
import cn.iocoder.yudao.module.crm.controller.admin.bi.vo.CrmBiRankReqVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CRM BI 排行榜 Service 接口
|
||||||
|
*
|
||||||
|
* @author anhaohao
|
||||||
|
*/
|
||||||
|
public interface CrmBiRankingService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得合同金额排行榜
|
||||||
|
*
|
||||||
|
* @param rankReqVO 排行参数
|
||||||
|
* @return 合同金额排行榜
|
||||||
|
*/
|
||||||
|
List<CrmBiRanKRespVO> getContractPriceRank(CrmBiRankReqVO rankReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得回款金额排行榜
|
||||||
|
*
|
||||||
|
* @param rankReqVO 排行参数
|
||||||
|
* @return 回款金额排行榜
|
||||||
|
*/
|
||||||
|
List<CrmBiRanKRespVO> getReceivablePriceRank(CrmBiRankReqVO rankReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.crm.dal.mysql.bi.CrmBiRankingMapper">
|
||||||
|
|
||||||
|
<select id="selectContractPriceRank"
|
||||||
|
resultType="cn.iocoder.yudao.module.crm.controller.admin.bi.vo.CrmBiRanKRespVO">
|
||||||
|
SELECT IFNULL(SUM(price), 0) AS count, owner_user_id
|
||||||
|
FROM crm_contract
|
||||||
|
WHERE deleted = 0
|
||||||
|
AND audit_status = 20
|
||||||
|
and owner_user_id in
|
||||||
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||||
|
#{userId}
|
||||||
|
</foreach>
|
||||||
|
AND order_date between #{times[0],javaType=java.time.LocalDateTime} and #{times[1],javaType=java.time.LocalDateTime}
|
||||||
|
GROUP BY owner_user_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectReceivablePriceRank"
|
||||||
|
resultType="cn.iocoder.yudao.module.crm.controller.admin.bi.vo.CrmBiRanKRespVO">
|
||||||
|
SELECT IFNULL(SUM(price), 0) AS count, owner_user_id
|
||||||
|
FROM crm_receivable
|
||||||
|
WHERE deleted = 0
|
||||||
|
AND audit_status = 20
|
||||||
|
and owner_user_id in
|
||||||
|
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||||
|
#{userId}
|
||||||
|
</foreach>
|
||||||
|
AND return_time between #{times[0],javaType=java.time.LocalDateTime} and #{times[1],javaType=java.time.LocalDateTime}
|
||||||
|
GROUP BY owner_user_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue