Commit 56afc391 authored by tianbo's avatar tianbo

feat(statistics): 修改合格率计算逻辑使用设备数量替代单据数量

parent 5c0da1b9
...@@ -147,6 +147,8 @@ public interface JyjcInspectionApplicationMapper extends BaseMapper<JyjcInspecti ...@@ -147,6 +147,8 @@ public interface JyjcInspectionApplicationMapper extends BaseMapper<JyjcInspecti
List<Map<String, Object>> selectPieLineListOfNoInspectInfo(@Param("records") List<String> records); List<Map<String, Object>> selectPieLineListOfNoInspectInfo(@Param("records") List<String> records);
Page<JSONObject> selectEquipList(Page<JSONObject> page,@Param("queryParams") Map<String, Object> map); Page<JSONObject> selectEquipList(Page<JSONObject> page,@Param("queryParams") Map<String, Object> map);
Long queryAllFinishedEquipCount(@Param("orgCode") String orgCode, @Param("dpFilterParamDto") DPFilterParamDto dpFilterParamDto);
} }
...@@ -898,4 +898,20 @@ ...@@ -898,4 +898,20 @@
</if> </if>
order by ibjui.REC_DATE DESC order by ibjui.REC_DATE DESC
</select> </select>
<select id="queryAllFinishedEquipCount" resultType="java.lang.Long">
SELECT
count(1)
FROM
tz_jyjc_inspection_application a,
tz_base_enterprise_info b,
tz_jyjc_inspection_result r
where
a.inspection_unit_code= b.use_unit_code
and a.application_no = r.application_no
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 ('%', #{dpFilterParamDto.cityCode}, '%')))
and a.status = '6616'
and EXISTS (select 1 from tz_jyjc_inspection_result r where r.result_status='2' and a.application_no = r.application_no)
and date_ge(CAST(a.accept_date as date),#{dpFilterParamDto.beginDate}) and date_le(CAST(a.accept_date as date),#{dpFilterParamDto.endDate})
</select>
</mapper> </mapper>
...@@ -994,10 +994,12 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -994,10 +994,12 @@ public class JYJCDPStatisticsServiceImpl {
//受理数量 //受理数量
Long pendingCount = inspectionApplicationMapper.queryAllPendingAndFinishedCount(orgCode, dpFilterParamDto); Long pendingCount = inspectionApplicationMapper.queryAllPendingAndFinishedCount(orgCode, dpFilterParamDto);
ydata.add(pendingCount); ydata.add(pendingCount);
//检验完成 //检验完成单据数量
Long finshCount = inspectionApplicationMapper.queryAllFinishedCount(orgCode, dpFilterParamDto); Long finshCount = inspectionApplicationMapper.queryAllFinishedCount(orgCode, dpFilterParamDto);
ydata.add(finshCount); ydata.add(finshCount);
//检验合格数量 //检验完成单据对应设备数量
Long finshEquipCount = inspectionApplicationMapper.queryAllFinishedEquipCount(orgCode, dpFilterParamDto);
//检验合格设备数量
Long qualifiedCount = inspectionApplicationMapper.queryQualifiedCount(orgCode, dpFilterParamDto); Long qualifiedCount = inspectionApplicationMapper.queryQualifiedCount(orgCode, dpFilterParamDto);
// 计算比率 // 计算比率
...@@ -1006,8 +1008,8 @@ public class JYJCDPStatisticsServiceImpl { ...@@ -1006,8 +1008,8 @@ public class JYJCDPStatisticsServiceImpl {
completionRate = (double) finshCount / pendingCount; completionRate = (double) finshCount / pendingCount;
} }
double qualifiedRate = 0.0; double qualifiedRate = 0.0;
if (finshCount != 0 && qualifiedCount != 0) { if (finshEquipCount != 0 && qualifiedCount != 0) {
qualifiedRate = (double) qualifiedCount / finshCount; qualifiedRate = (double) qualifiedCount / finshEquipCount;
} }
String[] xdata = { String[] xdata = {
"报检", "报检",
......
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