Commit 99ee0e55 authored by suhuiguang's avatar suhuiguang

1.总览接口调整

parent 39c8d716
......@@ -1009,7 +1009,7 @@
and date_ge(CAST(a.application_date as date),#{dto.beginDate})
and date_le(CAST(a.application_date as date),#{dto.endDate})
union all
SELECT count(1) FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status = '已完成' and date_ge(CAST(reg_date as date),#{dto.beginDate}) and date_le(CAST(reg_date as date),#{dto.endDate})
SELECT count(1) FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and date_ge(CAST(reg_date as date),#{dto.beginDate}) and date_le(CAST(reg_date as date),#{dto.endDate})
union all
SELECT
count(1)
......@@ -1031,7 +1031,7 @@
union all
SELECT count(1) as num FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成' and date_ge(CAST(reg_date as date),#{dto.beginDate}) and date_le(CAST(reg_date as date),#{dto.endDate})
union all
SELECT count(1) as num FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status = '已完成' and date_ge(CAST(apply_date as date),#{dto.beginDate}) and date_le(CAST(apply_date as date),#{dto.endDate})
SELECT count(1) as num FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and date_ge(CAST(apply_date as date),#{dto.beginDate}) and date_le(CAST(apply_date as date),#{dto.endDate})
)
union all
select count(1) from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成' and date_ge(CAST(a.create_date as date),#{dto.beginDate}) and date_le(CAST(a.create_date as date),#{dto.endDate})
......
......@@ -565,6 +565,7 @@ public class JGDPStatisticsServiceImpl {
/**
* 临期检验设备数统计
*
* @param dpFilterParamDto 过滤条件
* @return 临期设备的数量
*/
......@@ -596,6 +597,7 @@ public class JGDPStatisticsServiceImpl {
/**
* 超期检验设备数统计
*
* @param dpFilterParamDto 过滤条件
* @return 超期设备的数量
*/
......@@ -662,14 +664,14 @@ public class JGDPStatisticsServiceImpl {
private long countCompanyForCertDateTemporary(DPFilterParamDto dpFilterParamDto) {
String orgCode = getAndSetOrgCode(dpFilterParamDto.getCityCode());
// 临期6个月
String limitDate = DateUtil.offset(DateUtil.date(), DateField.DAY_OF_MONTH,6).toDateStr();
return zlStatisticsMapper.countCompanyForCertDateTemporary(dpFilterParamDto,orgCode, limitDate);
String limitDate = DateUtil.offset(DateUtil.date(), DateField.DAY_OF_MONTH, 6).toDateStr();
return zlStatisticsMapper.countCompanyForCertDateTemporary(dpFilterParamDto, orgCode, limitDate);
}
private long countCompanyForCertDateTimeOut(DPFilterParamDto dpFilterParamDto) {
String orgCode = getAndSetOrgCode(dpFilterParamDto.getCityCode());
String limitDate = DateUtil.today();
return zlStatisticsMapper.countCompanyForCertDateTimeOut(dpFilterParamDto,orgCode, limitDate);
return zlStatisticsMapper.countCompanyForCertDateTimeOut(dpFilterParamDto, orgCode, limitDate);
}
......@@ -725,10 +727,30 @@ public class JGDPStatisticsServiceImpl {
Long allFinishedCount = ydata.stream().mapToLong(e -> e).sum();
result.put("ydata", ydata);
result.put("allCount", allFinishedCount);
result.put("percentData", this.calEveryPercent(dpFilterParamDto, ydata));
result.put("completionRate", this.calPercentForBizCycleData(dpFilterParamDto, allFinishedCount));
return result;
}
private List<String> calEveryPercent(DPFilterParamDto dpFilterParamDto, List<Long> everyFinished) {
List<Long> everyInFlow = countBizDataInFlowing(dpFilterParamDto);
List<String> percentArray = new ArrayList<>();
for (int i = 0; i < everyInFlow.size(); i++) {
Long flowIng = everyInFlow.get(i);
Long finished = everyFinished.get(i);
BigDecimal flowIngBig = new BigDecimal(flowIng.toString());
BigDecimal all = flowIngBig.add(new BigDecimal(finished.toString()));
if (all.compareTo(BigDecimal.ZERO) > 0) {
BigDecimal percent = flowIngBig.divide(all, 2, RoundingMode.HALF_UP);
BigDecimal percentX100 = percent.multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP);
percentArray.add(percentX100.toPlainString());
} else {
percentArray.add("0");
}
}
return percentArray;
}
private String calPercentForBizCycleData(DPFilterParamDto dpFilterParamDto, Long allFinishedCount) {
Long allBizDataInFlowingCount = this.countAllBizDataInFlowing(dpFilterParamDto);
BigDecimal finish = new BigDecimal(String.valueOf(allFinishedCount));
......@@ -749,6 +771,11 @@ public class JGDPStatisticsServiceImpl {
return inFlowingForDP.stream().mapToLong(e -> e).sum();
}
private List<Long> countBizDataInFlowing(DPFilterParamDto dpFilterParamDto) {
String orgCode = getAndSetOrgCode(dpFilterParamDto.getCityCode());
return commonMapper.countAllInFlowingForDPNoFinishedBizData(orgCode, dpFilterParamDto);
}
private List<Long> countBizFinishedNum(DPFilterParamDto dpFilterParamDto) {
// 1.统计各业务办理量注意要和x轴顺序一致
String orgCode = getAndSetOrgCode(dpFilterParamDto.getCityCode());
......@@ -801,7 +828,7 @@ public class JGDPStatisticsServiceImpl {
*/
for (int i = 0; i < 4; i++) {
Map<String, Object> map = new HashMap();
if (i == 0) {
if (i == 0) {
map.put("name", "在用");
} else if (i == 1) {
map.put("name", "停用");
......@@ -1296,7 +1323,7 @@ public class JGDPStatisticsServiceImpl {
legendData.add(map);
}
resultMap.put("legendData", legendData);
List<String> xDataList = Arrays.asList( "电梯", "压力容器", "锅炉", "起重机械", "场(厂)内专用", "大型游乐设施", "压力管道", "客运索道");
List<String> xDataList = Arrays.asList("电梯", "压力容器", "锅炉", "起重机械", "场(厂)内专用", "大型游乐设施", "压力管道", "客运索道");
resultMap.put("xdata", xDataList);
List installNotify = new ArrayList<>();
List transformNotify = new ArrayList<>();
......@@ -1314,7 +1341,7 @@ public class JGDPStatisticsServiceImpl {
* 9000 客运索道
*/
for (int i = 0; i < xDataList.size(); i++) {
if (i == 0) {
if (i == 0) {
installNotify.add(installCountMap.getOrDefault("3000", 0));
transformNotify.add(reformCountMap.getOrDefault("3000", 0));
maintainNotify.add(maintenanceCountMap.getOrDefault("3000", 0));
......@@ -1709,7 +1736,7 @@ public class JGDPStatisticsServiceImpl {
private void staticsCenterMapCountDataForOver15Years(Map<String, Object> result, String orgCode) {
String time = LocalDate.now().minusYears(15).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
Long num = dpStatisticsMapper.over15yearsCount(orgCode,time);
Long num = dpStatisticsMapper.over15yearsCount(orgCode, time);
result.put(DPMapStatisticsItemEnum.OVER15YEARS_ELEVATORS.getCode(), num);
}
......@@ -1720,7 +1747,7 @@ public class JGDPStatisticsServiceImpl {
}
private void staticsCenterMapCountCertificate(Map<String, Object> result, String orgCode) {
long num = dpStatisticsMapper.certificateCountByOrgCode(orgCode);
long num = dpStatisticsMapper.certificateCountByOrgCode(orgCode);
result.put(DPMapStatisticsItemEnum.CERTIFICATE_COUNT.getCode(), num);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment