Commit 737fbd0f authored by 麻笑宇's avatar 麻笑宇

修改大屏总揽办结率去掉已完成筛选

parent 55e31488
......@@ -1185,8 +1185,13 @@
</select>
<select id="countBizFinishedNumForDPList" resultType="java.util.Map">
SELECT * FROM (SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate FROM "tzs_jg_installation_notice" where
receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status = '6616'
receiveOrgName,create_date as createDate,handle_date as handleDate,
CASE when notice_status = 0 then '已完成'
ELSE '未完成'
END as status
FROM "tzs_jg_installation_notice"
where
receive_company_org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(handle_date as date),#{dto.beginDate})
</if>
......@@ -1202,14 +1207,17 @@
union all
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate
receiveOrgName,application_date as createDate,accept_date as handleDate,
CASE when a.notice_status = 0 then '已完成'
ELSE '未完成'
END as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
and a.status = '6616' and a.biz_type = 'supervise'
and a.biz_type = 'supervise'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.accept_date as date),#{dto.beginDate})
</if>
......@@ -1224,7 +1232,7 @@
</if>
union all
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1239,7 +1247,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1255,14 +1263,17 @@
)
union all
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
CASE when a.notice_status = 0 then '已完成'
ELSE '未完成'
END as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
and a.status = '6616' and a.inspection_type = 'DQJY'
a.inspection_type = 'DQJY'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.accept_date as date),#{dto.beginDate})
</if>
......@@ -1277,7 +1288,7 @@
</if>
union all
SELECT * FROM (
SELECT a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status = '已完成'
SELECT a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status FROM tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1291,7 +1302,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1305,7 +1316,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1319,7 +1330,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1333,7 +1344,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1348,7 +1359,7 @@
</if>
)
union all
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate 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 = '已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1596,7 +1607,10 @@
</if>
</select>
<select id="countBizFinishedNumForDPListAZGZ" resultType="java.util.Map">
SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,handle_date as handleDate FROM "tzs_jg_installation_notice" where receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status = '6616'
SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,handle_date as handleDate,
CASE when notice_status = 0 then '已完成'
ELSE '未完成'
END as status FROM "tzs_jg_installation_notice" where receive_company_org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(handle_date as date),#{dto.beginDate})
</if>
......@@ -1612,14 +1626,17 @@
</select>
<select id="countBizFinishedNumForDPListJDJY" resultType="java.util.Map">
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
CASE when a.notice_status = 0 then '已完成'
ELSE '未完成'
END as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
and a.status = '6616' and a.biz_type = 'supervise'
and a.biz_type = 'supervise'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.accept_date as date),#{dto.beginDate})
</if>
......@@ -1635,7 +1652,7 @@
</select>
<select id="countBizFinishedNumForDPListSYDJ" resultType="java.util.Map">
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1648,7 +1665,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1665,14 +1682,17 @@
</select>
<select id="countBizFinishedNumForDPListDQJY" resultType="java.util.Map">
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
CASE when a.notice_status = 0 then '已完成'
ELSE '未完成'
END as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
where
a.inspection_unit_code= b.use_unit_code
and ((b.supervise_org_code != '50' and b.supervise_org_code LIKE CONCAT (#{orgCode}, '%')) or (b.supervise_org_code = '50' and b.office_region LIKE CONCAT ('%', #{dto.cityCode}, '%')))
and a.status = '6616' and a.inspection_type = 'DQJY'
and a.inspection_type = 'DQJY'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.accept_date as date),#{dto.beginDate})
</if>
......@@ -1688,7 +1708,7 @@
</select>
<select id="countBizFinishedNumForDPListBGDJ" resultType="java.util.Map">
SELECT * FROM (
SELECT a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status = '已完成'
SELECT a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status FROM tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1702,7 +1722,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1716,7 +1736,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1730,7 +1750,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1744,7 +1764,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status = '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1760,7 +1780,7 @@
)
</select>
<select id="countBizFinishedNumForDPListZXBX" resultType="java.util.Map">
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate 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 = '已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%')
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if>
......
......@@ -631,14 +631,25 @@ public class JGDPStatisticsServiceImpl {
this.setDefaultFilter(dpFilterParamDto);
result.put("xdata", Arrays.asList("安装告知", "监督检验", "使用登记", "定期检验", "变更登记", "注销报废"));
List<Long> ydata = this.countBizFinishedNum(dpFilterParamDto);
Long allFinishedCount = ydata.stream().mapToLong(e -> e).sum();
result.put("ydata", ydata);
Long allFinishedCount = this.calEveryAll(dpFilterParamDto, ydata).stream().mapToLong(e -> e).sum();
result.put("ydata", this.calEveryAll(dpFilterParamDto, ydata));
result.put("allCount", allFinishedCount);
result.put("percentData", this.calEveryPercent(dpFilterParamDto, ydata));
result.put("completionRate", this.calPercentForBizCycleData(dpFilterParamDto, allFinishedCount));
return result;
}
private List<Long> calEveryAll(DPFilterParamDto dpFilterParamDto, List<Long> everyFinished) {
List<Long> everyInFlow = countBizDataInFlowing(dpFilterParamDto);
List<Long> allArray = new ArrayList<>();
for (int i = 0; i < everyInFlow.size(); i++) {
Long flowIng = everyInFlow.get(i);
Long finished = everyFinished.get(i);
allArray.add(flowIng+finished);
}
return allArray;
}
private List<String> calEveryPercent(DPFilterParamDto dpFilterParamDto, List<Long> everyFinished) {
List<Long> everyInFlow = countBizDataInFlowing(dpFilterParamDto);
List<String> percentArray = new ArrayList<>();
......@@ -650,8 +661,7 @@ public class JGDPStatisticsServiceImpl {
BigDecimal all = flowIngBig.add(finishedBig);
if (all.compareTo(BigDecimal.ZERO) > 0) {
BigDecimal percent = finishedBig.divide(all, 2, RoundingMode.HALF_UP);
BigDecimal percentX100 = percent.multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP);
percentArray.add(percentX100.toPlainString());
percentArray.add(percent.toPlainString());
} else {
percentArray.add("0");
}
......@@ -1562,12 +1572,11 @@ public class JGDPStatisticsServiceImpl {
BigDecimal all = everyNum.add(finishedNum);
if (all.compareTo(BigDecimal.ZERO) > 0) {
BigDecimal percent = finishedNum.divide(all, 2, RoundingMode.HALF_UP);
BigDecimal percentX100 = percent.multiply(new BigDecimal("100")).setScale(0, RoundingMode.HALF_UP);
itemResult.put("percentData", percentX100.toPlainString());
itemResult.put("percentData", percent.toPlainString());
} else {
itemResult.put("percentData", "0");
}
itemResult.put("finishedNum", finishedNum);
itemResult.put("finishedNum", all);
return itemResult;
}).collect(Collectors.toList());
......
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