企业信息统计 根据审核状态统计企业数据
This commit is contained in:
parent
7b662fad1a
commit
c1aa400445
|
@ -126,4 +126,11 @@ public class EnterpriseInformationController {
|
||||||
Map<String, Long> stringLongMap = enterpriseInformationService.selectEnterpriseByMonth();
|
Map<String, Long> stringLongMap = enterpriseInformationService.selectEnterpriseByMonth();
|
||||||
return success(stringLongMap);
|
return success(stringLongMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/statisticByStatus")
|
||||||
|
@Operation(summary = "根据审核状态统计企业数据")
|
||||||
|
public CommonResult<Map<Integer,Long>> statisticByStatus(){
|
||||||
|
Map<Integer, Long> integerLongMap = enterpriseInformationService.statisticByStatus();
|
||||||
|
return success(integerLongMap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,4 +100,10 @@ public interface EnterpriseInformationService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Map<String, Long> selectEnterpriseByMonth();
|
Map<String, Long> selectEnterpriseByMonth();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据审核状态统计企业数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<Integer,Long> statisticByStatus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -308,6 +308,17 @@ public class EnterpriseInformationServiceImpl implements EnterpriseInformationSe
|
||||||
return monthlyCounts;
|
return monthlyCounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据审核状态统计企业数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<Integer, Long> statisticByStatus() {
|
||||||
|
List<EnterpriseInformationDO> enterpriseInformationDOS = enterpriseInformationMapper.selectList();
|
||||||
|
Map<Integer, Long> statusCounts = enterpriseInformationDOS.stream().collect(Collectors.groupingBy(EnterpriseInformationDO::getStatus, Collectors.counting()));
|
||||||
|
return statusCounts;
|
||||||
|
}
|
||||||
|
|
||||||
private void validateLeaveExists(Long id) {
|
private void validateLeaveExists(Long id) {
|
||||||
if (enterpriseInformationMapper.selectById(id) == null) {
|
if (enterpriseInformationMapper.selectById(id) == null) {
|
||||||
throw exception(ENTERPRISE_INFORMATION_NOT_EXISTS);
|
throw exception(ENTERPRISE_INFORMATION_NOT_EXISTS);
|
||||||
|
|
Loading…
Reference in New Issue