d94a49ed 康伟

Merge remote-tracking branch 'origin/master'

2 个父辈 575fcc80 5bfa3e0b
......@@ -55,6 +55,7 @@ public class ScybReportHandle implements ICustomHandle{
dataFieldDict.put("depart_id", "厂站编码");
dataFieldDict.put("yddf", "电费");
dataFieldDict.put("wxfy", "设备维修费");
dataFieldDict.put("whfy", "设备维护费");
//获取填报数据
String dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"", departIds, month);
//结果集
......
......@@ -839,13 +839,16 @@
v4.bnsjyh,
v4.yhcyqyy,
c.cost AS yddf,
r.total_cost AS wxfy
r.total_cost AS wxfy,
w.maintenance_cost AS whfy
FROM
sys_depart d
LEFT JOIN ( SELECT * FROM ${dataViewName4411} v WHERE v.time = #{month} ) v4 ON v4.depart_id = d.id
LEFT JOIN ( SELECT cost,depart_id FROM report_electric_cost WHERE month = #{month} ) c ON c.depart_id = d.id
LEFT JOIN ( SELECT ROUND(SUM(total_cost),2) AS total_cost,depart_id FROM equipment_repair
WHERE LEFT(repair_date,7) = #{month} GROUP BY LEFT(repair_date,7),depart_id ) r ON r.depart_id = d.id
LEFT JOIN ( SELECT ROUND(SUM(maintenance_cost),2) AS maintenance_cost,depart_id FROM equipment_maintain_task
WHERE LEFT(maintain_time,7) = #{month} GROUP BY LEFT(maintain_time,7),depart_id ) w ON w.depart_id = d.id
WHERE
d.id IN
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
......
......@@ -102,24 +102,24 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
" round(100*(sum(v1.CSL)/10000-ifnull(tb.clsl_tb,0))/ifnull(tb.clsl_tb,sum(v1.CSL)/10000),2) as sjsldbbhl, " +
" v6.ysjsldyqntqyy, " +
" ifnull(v7.ysfsl,0) as qntqsfsl, " +
" v6.ysfsl,v6.sfsldbbhl, " +
" v6.ysfsl," +
" round(100*((v6.ysfsl-ifnull(v7.ysfsl,0))/ifnull(v7.ysfsl,0)),2) sfsldbbhl, " +
" rtc.target_water as ndslmb, " +
" round(100*(sum(v1.CSL)/10000)/rtc.target_water,2) yslwcbl, " +
" v6.sldyyqyy, " +
" round(v4.dlhj/sum(v1.CSL),2) as ydh," +
" round(ifnull(v5.dlhj/tb.clsl_tb,0)/10000,2) qntqdh, " +
" round(100*(v4.dlhj-ifnull(v5.dlhj,0))/ifnull(v5.dlhj,v4.dlhj),2) as dhdbbhl, " +
" round(100*((v4.dlhj/sum(v1.CSL))-(ifnull(v5.dlhj/tb.clsl_tb,0)/10000))/(ifnull(v5.dlhj/tb.clsl_tb,0)/10000),2) as dhdbbhl, " +
" v6.dhgyqntqyy, " +
" round(v6.yyf/sum(v1.CSL),2) as yyh, " +
" v6.yyf," +
" round(ifnull(v5.yjhl/tb.clsl_tb/10000,0),2) qntqyh, " +
" round(100*(v4.yjhl-ifnull(v5.yjhl,0))/ifnull(v5.yjhl,v4.yjhl),2) as yhdbbhl, " +
" round(100*(v6.yyf/sum(v1.CSL)-ifnull(v5.yjhl/tb.clsl_tb/10000,0))/ifnull(v5.yjhl/tb.clsl_tb/10000,1),2) as yhdbbhl, " +
" v6.yhgyqntqyy, " +
" rtc.target_power as bndhmb, " +
" round(y.dlhj_year/sum(v1.CSL),2) as bnsjdh, " +
" v6.dhcmbzyy,v6.df,v6.sbwhf, " +
" rtc.target_drug as bnyhmb, " +
// " round(y.yjhl_year/sum(v1.CSL),2) as bnsjyh, " +
" round(v4.yjhl/sum(v1.CSL),2) as bnsjyh, " +
" v6.yhcyqyy " +
" from "+dataViewName2119+" v1 " +
......
......@@ -91,16 +91,9 @@
</select>
<select id="getMaintainCost" parameterType="java.lang.String" resultType="java.lang.Double">
SELECT
IFNULL(
SUM(
etc.labor_cost + etc.material_cost + etc.maintenance_cost + etc.machinery_cost + etc.service_cost +
etc.wastage_cost + etc.other_cost
),
0
) AS cost
IFNULL(SUM(emt.material_cost),0) AS cost
FROM
equipment_maintain_task emt
LEFT JOIN equipment_task_cost etc ON etc.task_id = emt.id
WHERE
emt.del_flag = 0
<if test="startTime !=null and startTime !=''">
......
......@@ -93,6 +93,7 @@ public class EquipmentMaintainTaskServiceImpl extends ServiceImpl<EquipmentMaint
equipmentMaintainTaskVO.setMaintenanceFrontUrl(equipmentMaintainTask.getMaintenanceFrontUrl());
equipmentMaintainTaskVO.setMaintenanceAfterUrl(equipmentMaintainTask.getMaintenanceAfterUrl());
equipmentMaintainTaskVO.setResultsEnforcement(equipmentMaintainTask.getResultsEnforcement());
equipmentMaintainTaskVO.setMaintenanceCost(equipmentMaintainTask.getMaintenanceCost());
//维护内容
EquipmentMaintenanceContentVO equipmentMaintenanceContentVO = new EquipmentMaintenanceContentVO();
List<EquipmentMaintainStandardVO> standardByTaskId = baseMapper.getStandardByTaskId(id);
......@@ -197,6 +198,7 @@ public class EquipmentMaintainTaskServiceImpl extends ServiceImpl<EquipmentMaint
equipmentMaintainTask.setMaintenanceFrontUrl(equipmentMaintainTaskVO.getMaintenanceFrontUrl());
equipmentMaintainTask.setMaintenanceAfterUrl(equipmentMaintainTaskVO.getMaintenanceAfterUrl());
equipmentMaintainTask.setDeviceAdministratorId(equipmentMaintainTaskVO.getDeviceAdministratorId());
equipmentMaintainTask.setMaintenanceCost(equipmentMaintainTaskVO.getMaintenanceCost());
//新增验收情况
boolean checkTag = false;
......
......@@ -498,6 +498,7 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
public InspectionEquipIndicatorsVO getInspectionEquipIndicators(String startDate, String endDate) {
InspectionEquipIndicatorsVO inspectionEquipIndicatorsVO = new InspectionEquipIndicatorsVO();
//设置初始值
inspectionEquipIndicatorsVO.setFinishRate("0");
inspectionEquipIndicatorsVO.setCompletionRate("0");
inspectionEquipIndicatorsVO.setUnCompletionRate("0");
inspectionEquipIndicatorsVO.setAbnormalRate("0");
......@@ -584,6 +585,11 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
if (processInstanceStateMap != null && processInstanceStateMap.get(FlowEngineConstant.STATUS_FINISHED) != null) {
processedAbnormalItemsCount = processInstanceStateMap.get(FlowEngineConstant.STATUS_FINISHED).size();
}
//完成率
String finishRate = "0";
if (totalInspectionEquipCount != 0) {
finishRate = numberFormat.format(checkedInspectionEquipCount / (double) totalInspectionEquipCount * 100);
}
//覆盖率
String completionRate = "0";
if (totalInspectionEquipCount != 0) {
......@@ -604,6 +610,7 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
if (abnormalItemsCount != 0) {
processedAbnormalRate = numberFormat.format(processedAbnormalItemsCount / (double) abnormalItemsCount * 100);
}
inspectionEquipIndicatorsVO.setFinishRate(finishRate);
inspectionEquipIndicatorsVO.setCompletionRate(completionRate);
inspectionEquipIndicatorsVO.setUnCompletionRate(unCompletionRate);
inspectionEquipIndicatorsVO.setAbnormalRate(abnormalRate);
......@@ -932,7 +939,11 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService
abnormalCheckedItemsCount += ConvertUtils.getInt(abnormalTaskCheckedItemsCountMap.get(tempInspectionTaskId), 0);
}
inspectionAbnormalItemsTrendVO.setInspectionTaskDate(date);
if(totalCheckeItemsCount - checkedItemsCount < 0){
inspectionAbnormalItemsTrendVO.setNotCheckedItemsCount(0);
}else{
inspectionAbnormalItemsTrendVO.setNotCheckedItemsCount(totalCheckeItemsCount - checkedItemsCount);
}
inspectionAbnormalItemsTrendVO.setAbnormalItemsCount(abnormalCheckedItemsCount);
inspectionAbnormalItemsTrendVOList.add(inspectionAbnormalItemsTrendVO);
}
......
......@@ -39,6 +39,8 @@ public class InspectionEquipIndicatorsDetailVO {
@ApiModelProperty(value = "未检设备数")
private Integer notCheckedInspectionEquipCount;
@ApiModelProperty(value = "设备完成率")
private String finishRate;
@ApiModelProperty(value = "完成率")
private String completionRate;
@ApiModelProperty(value = "未检率")
......@@ -96,8 +98,14 @@ public class InspectionEquipIndicatorsDetailVO {
return processedAbnormalRate;
}
//覆盖率
//设备完成率
public String getFinishRate() {
finishRate = "0";//设备完成率
if (totalInspectionEquipCount != 0) {
finishRate = JSUtils.divide( checkedInspectionEquipCount*100 ,totalInspectionEquipCount );
}
return finishRate;
}
......
......@@ -17,6 +17,8 @@ import lombok.EqualsAndHashCode;
@ApiModel(value="巡检设备指标", description="巡检设备指标")
public class InspectionEquipIndicatorsVO {
@ApiModelProperty(value = "完成率")
private String finishRate;
@ApiModelProperty(value = "覆盖率")
private String completionRate;
@ApiModelProperty(value = "未检率")
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!